Skip to content

Commit

Permalink
feat: make email from name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
agrmohit committed Mar 1, 2024
1 parent ac28d38 commit 50d24da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ Configuration options available in the [config file](config.json)
| emailUser | string | Username/Email address of your email account |
| emailPassword | string | Password of your email account. Prefer app password |
| emailRecipient | string | Email address that should receive your ebook |
| emailFrom | string | Sender name that appears to the email receiver |
| emailAllowSTARTTLS | boolean | Allow connecting to the SMTP server using STARTTLS |
<!-- deno-fmt-ignore-end -->
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"emailUser": "[email protected]",
"emailPassword": "",
"emailRecipient": "[email protected]",
"emailFrom": "Omnivore EPUB Mailer",
"emailAllowSTARTTLS": true
}
4 changes: 2 additions & 2 deletions email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function sendEmail() {
});

const mailOptions = {
from: `Omnivore EPUB Mailer <${config.emailUser}>`,
from: `${config.emailFrom} <${config.emailUser}>`,
to: config.emailRecipient,
subject: config.title,
attachments: [
Expand All @@ -30,7 +30,7 @@ export async function sendEmail() {
})
) {
try {
console.log(`📧 Sending email from 'Omnivore EPUB Mailer <${config.emailUser}>' to '${config.emailRecipient}'`);
console.log(`📧 Sending email from '${config.emailFrom} <${config.emailUser}>' to '${config.emailRecipient}'`);
const info = await transporter.sendMail(mailOptions);
console.log(`📨 Email sent: ${info.messageId}`);
} catch (error) {
Expand Down

0 comments on commit 50d24da

Please sign in to comment.