diff --git a/public/email/header-logo.png b/public/email/header-logo.png index 8340b6a3..304d33de 100644 Binary files a/public/email/header-logo.png and b/public/email/header-logo.png differ diff --git a/server/__snapshots__/mailer.test.js.snap b/server/__snapshots__/mailer.test.js.snap index c7071644..c1283272 100644 --- a/server/__snapshots__/mailer.test.js.snap +++ b/server/__snapshots__/mailer.test.js.snap @@ -43,7 +43,7 @@ Object { Outline is a place for your team to build and share knowledge. -
 
\\"Outline\\"
 

Welcome to Outline!

Outline is a place for your team to build and share knowledge.

To get started, head to your dashboard and try creating a collection to help document your workflow, create playbooks or help with team onboarding.

You can also import existing Markdown documents by dragging and dropping them to your collections.

 

View my dashboard

 
OutlineTwitterSpectrum
+
 
\\"Outline\\"
 

Welcome to Outline!

Outline is a place for your team to build and share knowledge.

To get started, head to your dashboard and try creating a collection to help document your workflow, create playbooks or help with team onboarding.

You can also import existing Markdown documents by dragging and dropping them to your collections.

 

View my dashboard

 
OutlineTwitterSpectrum
@@ -61,7 +61,7 @@ To get started, head to your dashboard and try creating a collection to help doc You can also import existing Markdown documents by dragging and dropping them to your collections. -http://localhost:3000/dashboard +http://example.com/dashboard ", "to": "user@example.com", } diff --git a/server/emails/WelcomeEmail.js b/server/emails/WelcomeEmail.js index 29caabfb..62b106d2 100644 --- a/server/emails/WelcomeEmail.js +++ b/server/emails/WelcomeEmail.js @@ -8,7 +8,11 @@ import Header from './components/Header'; import Footer from './components/Footer'; import EmptySpace from './components/EmptySpace'; -export const welcomeEmailText = ` +export type Props = { + teamUrl: string, +}; + +export const welcomeEmailText = ({ teamUrl }: Props) => ` Welcome to Outline! Outline is a place for your team to build and share knowledge. @@ -17,10 +21,10 @@ To get started, head to your dashboard and try creating a collection to help doc You can also import existing Markdown documents by dragging and dropping them to your collections. -${process.env.URL}/dashboard +${teamUrl}/dashboard `; -export const WelcomeEmail = () => { +export const WelcomeEmail = ({ teamUrl }: Props) => { return (
@@ -39,9 +43,7 @@ export const WelcomeEmail = () => {

- +

diff --git a/server/emails/components/Body.js b/server/emails/components/Body.js index 2adc4286..06c494e6 100644 --- a/server/emails/components/Body.js +++ b/server/emails/components/Body.js @@ -14,7 +14,7 @@ export default ({ children }: Props) => { - + {children} diff --git a/server/emails/components/Header.js b/server/emails/components/Header.js index f64849c7..fd25e4cb 100644 --- a/server/emails/components/Header.js +++ b/server/emails/components/Header.js @@ -13,8 +13,8 @@ export default () => { Outline diff --git a/server/mailer.js b/server/mailer.js index 274a8b33..f417b4fe 100644 --- a/server/mailer.js +++ b/server/mailer.js @@ -83,14 +83,14 @@ export class Mailer { } }; - welcome = async (opts: { to: string }) => { + welcome = async (opts: { to: string, teamUrl: string }) => { this.sendMail({ to: opts.to, title: 'Welcome to Outline', previewText: 'Outline is a place for your team to build and share knowledge.', - html: , - text: welcomeEmailText, + html: , + text: welcomeEmailText(opts), }); }; diff --git a/server/mailer.test.js b/server/mailer.test.js index 7d2f6e68..fc0d4945 100644 --- a/server/mailer.test.js +++ b/server/mailer.test.js @@ -16,7 +16,10 @@ describe('Mailer', () => { }); test('#welcome', () => { - fakeMailer.welcome({ to: 'user@example.com' }); + fakeMailer.welcome({ + to: 'user@example.com', + teamUrl: 'http://example.com', + }); expect(sendMailOutput).toMatchSnapshot(); }); }); diff --git a/server/models/User.js b/server/models/User.js index f2070f9c..e5ef8d4c 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -6,7 +6,7 @@ import subMinutes from 'date-fns/sub_minutes'; import { DataTypes, sequelize, encryptedFields } from '../sequelize'; import { publicS3Endpoint, uploadToS3FromUrl } from '../utils/s3'; import { sendEmail } from '../mailer'; -import { Star, Collection, NotificationSetting, ApiKey } from '.'; +import { Star, Team, Collection, NotificationSetting, ApiKey } from '.'; const User = sequelize.define( 'user', @@ -158,7 +158,10 @@ User.beforeDestroy(checkLastAdmin); User.beforeDestroy(removeIdentifyingInfo); User.beforeSave(uploadAvatar); User.beforeCreate(setRandomJwtSecret); -User.afterCreate(user => sendEmail('welcome', user.email)); +User.afterCreate(async user => { + const team = await Team.findById(user.teamId); + sendEmail('welcome', user.email, { teamUrl: team.url }); +}); // By default when a user signs up we subscribe them to email notifications // when documents they created are edited by other team members and onboarding