> For the complete documentation index, see [llms.txt](https://docs.tasksource.io/api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tasksource.io/api-documentation/send-emails.md).

# Send emails

### Input parameters

1. to\_email\_adress
2. template\_name
3. data (Data will be some other documents defined in each separate API call)

### How to call from app

```
import { httpsCallable } from 'firebase/functions';

await httpsCallable(functions, 'sendEmail')({ 
  to: to_email_adress,  
  template: { 
    name: template_name, 
    data: {taskData: currentTask, taskId: task.id}
  }
});
```

### Logic

1\.

```
emailData = {
  to: to_email_adress
  template: {
    name: template_name
    data: data
  }
```

\
2\. addDoc(collection(db, "send-emails"), emailData)
