# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tasksource.io/api-documentation/send-emails.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
