Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ _This config will only store form data in the Form Submissions Strapi Collection
|`notificationProviders[].enabled`|If you want this provider to be enabled|Boolean|
|`notificationProviders[].config`|Notification Provider Config|Object|
|`enableFormName`|Allow arbitrary form names set by client|Boolean|
|`allowUnsafeHtmlAsMessage`|Passes the formated message as html UNSAFE YOU MUST OVERRIDE FORMAT|Boolean|



## Strapi Admin Panel Configuration
Expand Down
12 changes: 9 additions & 3 deletions server/services/notification-providers/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ module.exports = ({strapi}) => ({
//loop through the recipients and send an email
for (let recipient of recipients) {
try {
await strapi.plugins['email'].services.email.send({
let sendObj = {
to: recipient.email,
from: config.from,
subject: config.subject ? config.subject : 'New Contact Form Submission',
text: message,
})
}
if (config.allowUnsafeHtmlAsMessage) {
sendObj.html = message
}else{
sendObj.text = message
}

await strapi.plugins['email'].services.email.send(sendObj)
} catch (e) {
strapi.log.error(e)
}
Expand Down