utopia.co.uk/contact-email-server/config.js

53 lines
1.4 KiB
JavaScript

const AWS = require("aws-sdk");
const SES_CONFIG = {
accessKeyId: "AKIAWCDCR7WSPJMY7OUU",
secretAccessKey: "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",
region: "us-east-1",
};
// SES object
const AWS_SES = new AWS.SES(SES_CONFIG);
// Specify the email address of the recipient
// const EMAIL_RECIPIENT = "customers@utopiadeals.com";
const EMAIL_RECIPIENT = "moiz.khalid@utopiadeals.com";
const PARAMS = (form) => {
//destruct object
const { name, email, phone, hearFrom, message } = form;
return {
Destination: {
ToAddresses: [EMAIL_RECIPIENT],
},
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: `<html>
<body>
<h2>Response has Received from ${name}</h2>
<p><b> Email :</b> ${email}</p>
<p><b> Phone :</b> ${phone}</p>
<p><b> Hear From :</b> ${hearFrom}</p>
<p><b> Message :</b> ${message}</p>
</body>
</html>`,
},
},
Subject: {
Charset: "UTF-8",
Data: "Utopia Deals Contact Form Details",
},
},
// Specify the email address of the sender
Source: email,
};
};
module.exports = {
AWS_SES: AWS_SES,
EMAIL_RECIPIENT: EMAIL_RECIPIENT,
PARAMS: PARAMS,
};