Function: getFollowUpTaskForEmail()
getFollowUpTaskForEmail(
svc,companyId,taskId):Promise<FollowUpEmailContext|null>
Defined in: src/db/queries/pipeline.ts:1291
Resolve everything an M-05 email draft/send needs for a task: the step's template/instructions, the target name, and the recipient — for a facility the persona-matched active contact (falling back to the primary, then any contact with an email); for a lead its stored contact. Null when the task isn't found in scope.
Parameters
svc
SupabaseClient
companyId
string
taskId
string
Returns
Promise<FollowUpEmailContext | null>