Merge pull request #411 from jorilallo/jori/reply-to

Added optional reply to address
This commit is contained in:
Jori Lallo
2017-11-18 13:16:36 -08:00
committed by GitHub
6 changed files with 9 additions and 3 deletions

View File

@@ -18,4 +18,5 @@ SMTP_HOST=
SMTP_PORT=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_SENDER_EMAIL=
SMTP_FROM_EMAIL=
SMTP_REPLY_EMAIL=

View File

@@ -10,7 +10,7 @@ machine:
DATABASE_URL_TEST: postgres://ubuntu@localhost:5432/circle_test
DATABASE_URL: postgres://ubuntu@localhost:5432/circle_test
URL: http://localhost:3000
SMTP_SENDER_EMAIL: hello@example.com
SMTP_FROM_EMAIL: hello@example.com
dependencies:
override:

View File

@@ -49,6 +49,7 @@ Object {
</body>
</html>
",
"replyTo": "hello@example.com",
"subject": "Welcome to Outline",
"text": "
Welcome to Outline!

View File

@@ -45,7 +45,8 @@ class Mailer {
try {
await transporter.sendMail({
from: process.env.SMTP_SENDER_EMAIL,
from: process.env.SMTP_FROM_EMAIL,
replyTo: process.env.SMTP_REPLY_EMAIL || process.env.SMTP_FROM_EMAIL,
to: data.to,
subject: data.title,
html: html,

View File

@@ -6,6 +6,8 @@ describe('Mailer', () => {
let sendMailOutput;
beforeEach(() => {
process.env.SMTP_FROM_EMAIL = 'hello@example.com';
fakeMailer = new Mailer();
fakeMailer.transporter = {
sendMail: output => (sendMailOutput = output),

View File

@@ -1,3 +1,4 @@
/* eslint-disable */
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';