added test variable when sending an e-mail
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import formData from 'form-data';
|
||||
import Mailgun from 'mailgun.js';
|
||||
import { createLogger } from './logger';
|
||||
import { MailgunMessageData } from 'mailgun.js/Types';
|
||||
|
||||
const log = createLogger("email:mailgun");
|
||||
|
||||
@@ -46,12 +47,14 @@ export async function sendEmail(message: EmailMessage): Promise<boolean> {
|
||||
const client = getMailgunClient();
|
||||
const domain = process.env.MAILGUN_DOMAIN || 'rezije.app';
|
||||
|
||||
const messageData = {
|
||||
const messageData:MailgunMessageData = {
|
||||
from: 'rezije.app <noreply@rezije.app>',
|
||||
to: message.to,
|
||||
subject: message.subject,
|
||||
html: message.html
|
||||
};
|
||||
html: message.html,
|
||||
"v:locationID": "12345" // testing custom variable - webhook should pick this up
|
||||
} as MailgunMessageData;
|
||||
|
||||
|
||||
log(`Sending email to ${message.to}: ${message.subject}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user