Addressed comments
This commit is contained in:
@ -42,7 +42,7 @@ Object {
|
|||||||
<tr>
|
<tr>
|
||||||
<td align=\\"center\\">
|
<td align=\\"center\\">
|
||||||
<span style=\\"display: none !important; color: #FFFFFF; margin:0; padding:0; font-size:1px; line-height:1px;\\">Outline is a place for your team to build and share knowledge.</span>
|
<span style=\\"display: none !important; color: #FFFFFF; margin:0; padding:0; font-size:1px; line-height:1px;\\">Outline is a place for your team to build and share knowledge.</span>
|
||||||
<table width=\\"550\\" padding=\\"40\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td align=\\"left\\"><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"40px\\" style=\\"line-height:40px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table><p><strong>Welcome to Outline!</strong></p><p>Outline is a place for your team to build and share knowledge.</p><p>To get started, head to your dashboard and try creating a collection to help document your workflow, create playbooks or help with team onboarding.</p><p>You can also import existing Markdown document by drag and dropping them to your collections</p><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"10px\\" style=\\"line-height:10px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table><p><a href=\\"http://localhost:3000/dashboard\\" style=\\"display:inline-block;padding:10px 20px;color:#FFFFFF;background:#000000;border-radius:4px;font-weight:500;text-decoration:none;cursor:pointer\\">View my dashboard</a></p><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"40px\\" style=\\"line-height:40px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table></td></tr></tbody></table><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"75%\\" style=\\"padding:20px 0;border-top:1px solid #e8e8e8;color:#9BA6B2;font-size:14px\\"><a href=\\"http://localhost:3000\\" style=\\"color:#9BA6B2;text-decoration:none\\">Outline</a></td></tr></tbody></table></td></tr></tbody></table>
|
<table width=\\"550\\" padding=\\"40\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td align=\\"left\\"><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"40px\\" style=\\"line-height:40px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table><p><strong>Welcome to Outline!</strong></p><p>Outline is a place for your team to build and share knowledge.</p><p>To get started, head to your dashboard and try creating a collection to help document your workflow, create playbooks or help with team onboarding.</p><p>You can also import existing Markdown document by drag and dropping them to your collections</p><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"10px\\" style=\\"line-height:10px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table><p><a href=\\"http://localhost:3000/dashboard\\" style=\\"display:inline-block;padding:10px 20px;color:#FFFFFF;background:#000000;border-radius:4px;font-weight:500;text-decoration:none;cursor:pointer\\">View my dashboard</a></p><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td width=\\"100%\\" height=\\"40px\\" style=\\"line-height:40px;font-size:1px;mso-line-height-rule:exactly\\"> </td></tr></tbody></table></td></tr></tbody></table><table width=\\"100%\\" border=\\"0\\" cellSpacing=\\"0\\" cellPadding=\\"0\\"><tbody><tr><td style=\\"padding:20px 0;border-top:1px solid #E8EBED;color:#9BA6B2;font-size:14px\\"><a href=\\"http://localhost:3000\\" style=\\"color:#9BA6B2;text-decoration:none\\">Outline</a></td></tr></tbody></table></td></tr></tbody></table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Table, TBody, TR, TD } from 'oy-vey';
|
import { Table, TBody, TR, TD } from 'oy-vey';
|
||||||
|
import { color } from '../../../shared/styles/constants';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const style = {
|
const style = {
|
||||||
padding: '20px 0',
|
padding: '20px 0',
|
||||||
borderTop: '1px solid #e8e8e8',
|
borderTop: `1px solid ${color.smokeDark}`,
|
||||||
color: '#9BA6B2',
|
color: color.slate,
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
};
|
};
|
||||||
|
|
||||||
const linkStyle = {
|
const linkStyle = {
|
||||||
color: '#9BA6B2',
|
color: color.slate,
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ export default () => {
|
|||||||
<Table width="100%">
|
<Table width="100%">
|
||||||
<TBody>
|
<TBody>
|
||||||
<TR>
|
<TR>
|
||||||
<TD width="75%" style={style}>
|
<TD style={style}>
|
||||||
<a href={process.env.URL} style={linkStyle}>
|
<a href={process.env.URL} style={linkStyle}>
|
||||||
Outline
|
Outline
|
||||||
</a>
|
</a>
|
||||||
|
@ -15,11 +15,14 @@ router.get('/:type/:format', async ctx => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
switch (ctx.params.type) {
|
switch (ctx.params.type) {
|
||||||
case 'welcome':
|
// case 'emailWithProperties':
|
||||||
previewMailer.welcome('user@example.com');
|
// previewMailer.emailWithProperties('user@example.com', {...properties});
|
||||||
break;
|
// break;
|
||||||
default:
|
default:
|
||||||
throw httpErrors.NotFound();
|
if (Object.getOwnPropertyNames(previewMailer).includes(ctx.params.type)) {
|
||||||
|
// $FlowIssue flow doesn't like this but we're ok with it
|
||||||
|
previewMailer[ctx.params.type]('user@example.com');
|
||||||
|
} else throw httpErrors.NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mailerOutput) return;
|
if (!mailerOutput) return;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import nodemailer from 'nodemailer';
|
import nodemailer from 'nodemailer';
|
||||||
import Oy from 'oy-vey';
|
import Oy from 'oy-vey';
|
||||||
import invariant from 'invariant';
|
|
||||||
import { baseStyles } from './emails/components/EmailLayout';
|
import { baseStyles } from './emails/components/EmailLayout';
|
||||||
|
|
||||||
import { WelcomeEmail, welcomeEmailText } from './emails/WelcomeEmail';
|
import { WelcomeEmail, welcomeEmailText } from './emails/WelcomeEmail';
|
||||||
@ -22,8 +21,8 @@ type SendMailType = {
|
|||||||
*
|
*
|
||||||
* Mailer class to contruct and send emails.
|
* Mailer class to contruct and send emails.
|
||||||
*
|
*
|
||||||
* To preview emails, add a new preview to `emails/index.js` and visit following
|
* To preview emails, add a new preview to `emails/index.js` if they
|
||||||
* URLs in development mode:
|
* require additional data (properties). Otherwise preview will work automatically.
|
||||||
*
|
*
|
||||||
* HTML: http://localhost:3000/email/:email_type/html
|
* HTML: http://localhost:3000/email/:email_type/html
|
||||||
* TEXT: http://localhost:3000/email/:email_type/text
|
* TEXT: http://localhost:3000/email/:email_type/text
|
||||||
@ -35,16 +34,17 @@ class Mailer {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
sendMail = async (data: SendMailType): ?Promise<*> => {
|
sendMail = async (data: SendMailType): ?Promise<*> => {
|
||||||
if (this.transporter) {
|
const { transporter } = this;
|
||||||
|
|
||||||
|
if (transporter) {
|
||||||
const html = Oy.renderTemplate(data.html, {
|
const html = Oy.renderTemplate(data.html, {
|
||||||
title: data.title,
|
title: data.title,
|
||||||
headCSS: [baseStyles, data.headCSS].join(' '),
|
headCSS: [baseStyles, data.headCSS].join(' '),
|
||||||
previewText: data.previewText,
|
previewText: data.previewText,
|
||||||
});
|
});
|
||||||
|
|
||||||
invariant(this.transporter, 'very sure this.transporter exists');
|
|
||||||
try {
|
try {
|
||||||
await this.transporter.sendMail({
|
await transporter.sendMail({
|
||||||
from: process.env.SMTP_SENDER_EMAIL,
|
from: process.env.SMTP_SENDER_EMAIL,
|
||||||
to: data.to,
|
to: data.to,
|
||||||
subject: data.title,
|
subject: data.title,
|
||||||
|
Reference in New Issue
Block a user