📧Send emails
Send emails docu
Input parameters
to_email_adress
template_name
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)
Last updated