Skip to content

Commit

Permalink
Merge pull request #16 from meshhq/feature/update-confirmation-emails
Browse files Browse the repository at this point in the history
Updating confirmation email templates
  • Loading branch information
sgruse authored Mar 11, 2019
2 parents adc944d + a508ccb commit c33b335
Show file tree
Hide file tree
Showing 25 changed files with 355 additions and 116 deletions.
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export { DCEmails };
export declare const CompileGenericEmail: (content: string, club: core.Club.Model) => Promise<string>;
export declare const CompileEventEmail: (event: core.Event.Model, club: core.Club.Model) => Promise<string>;
export declare const CompilePostEmail: (post: core.Post.Model, club: core.Club.Model) => Promise<string>;
export declare const CompileConfirmationEmail: (event: core.Event.Model, club: core.Club.Model) => Promise<string>;
export declare const CompileConfirmationEmail: (reservation: core.Event.Reservation, event: core.Event.Model, group: core.Calendar.CalendarGroup, club: core.Club.Model) => Promise<string>;
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ exports.CompilePostEmail = (post, club) => {
const path = `${__dirname}/templates/post.html`;
return CompileEmail(path, postInfo);
};
exports.CompileConfirmationEmail = (event, club) => {
const confirmationInfo = transform.BuildConfirmationContent(event, club);
exports.CompileConfirmationEmail = (reservation, event, group, club) => {
const confirmationInfo = transform.BuildConfirmationContent(reservation, event, group, club);
const path = `${__dirname}/templates/confirmation.html`;
return CompileEmail(path, confirmationInfo);
};
Expand Down
1 change: 1 addition & 0 deletions dist/models/confirmation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ClubInfo } from './club';
export interface ConfirmationInfo {
title: string;
subtitle: string;
icon: string;
info: string;
url: string;
unsubscribeURL: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/templates/confirmation.html

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions dist/templates/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ img {
background-color: #f3f3f3;
vertical-align: middle; }

.logo-col {
padding: 18px 0px; }
.logo-col img {
max-height: 60px; }

.button {
margin-bottom: 0px !important; }

Expand Down Expand Up @@ -428,10 +433,9 @@ img {
justify-content: center;
flex-direction: column;
text-align: center; }
.container.body.confirmation-body .confirmation-icon-container .feather {
stroke: #467FD0;
font-size: 24px;
width: 62px; }
.container.body.confirmation-body .confirmation-icon-container i {
color: #467FD0;
font-size: 24px; }

.container.body.confirmation-body .button {
margin-bottom: 0px; }
Expand All @@ -445,11 +449,6 @@ img {
.event-body a {
line-height: 1.75rem; }

.event-body .logo-col {
padding: 18px 0px; }
.event-body .logo-col img {
max-height: 60px; }

.event-body .detail-header {
font-size: 12px;
font-weight: 500;
Expand Down
2 changes: 1 addition & 1 deletion dist/templates/event.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/templates/generic.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/templates/post.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/transform/transform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import { ClubInfo } from '../models/club';
export declare const BuildGenericContent: (content: string, club: core.Club.Model) => RichContent;
export declare const BuildEventContent: (event: core.Event.Model, club: core.Club.Model) => EventInfo;
export declare const BuildPostContent: (post: core.Post.Model, club: core.Club.Model) => RichContent;
export declare const BuildConfirmationContent: (event: core.Event.Model, club: core.Club.Model) => ConfirmationInfo;
export declare const BuildConfirmationContent: (reservation: core.Event.Reservation, event: core.Event.Model, group: core.Calendar.CalendarGroup, club: core.Club.Model) => ConfirmationInfo;
export declare const BuildClubInfo: (club: core.Club.Model) => ClubInfo;
42 changes: 38 additions & 4 deletions dist/transform/transform.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core = require("club-hub-core");
exports.BuildGenericContent = (content, club) => {
const richContent = {
content: content,
Expand Down Expand Up @@ -40,11 +41,44 @@ exports.BuildPostContent = (post, club) => {
};
return postInfo;
};
exports.BuildConfirmationContent = (event, club) => {
exports.BuildConfirmationContent = (reservation, event, group, club) => {
let title;
let subtitle;
let info;
let icon;
var timeOptions = { hour: 'numeric', minute: 'numeric' };
const time = event.start.toLocaleDateString("en-US", timeOptions);
var dayOptions = { weekday: 'long', month: 'long', day: 'numeric' };
const day = event.start.toLocaleDateString("en-US", dayOptions);
if (group.name === core.Calendar.CalendarGroupName.Golf) {
title = 'Tee Time Confirmation';
subtitle = `Your tee time at ${club.name} has been confirmed.`;
info = `${reservation.participants.length} golfers on ${day} at ${time}.`;
icon = 'fas fa-golf-ball';
}
else if (group.name === 'Dining Room') {
title = 'Dining Confirmation';
subtitle = `Your dining reservation at ${club.name} has been confirmed.`;
info = `${reservation.participants.length} diners on ${day} at ${time}.`;
icon = 'fas fa-utensils';
}
else if (group.name === 'Service Providers') {
title = 'Vehicle Service Confirmation';
subtitle = `Your vehicle service reservation with ${club.name} has been confirmed.`;
info = `${reservation.participants.length} vehicle on ${day} at ${time}.`;
icon = 'fas fa-car';
}
else {
title = 'Event Confirmation';
subtitle = `Your reservation for ${event.name} has been confirmed`;
info = `${event.name} takes place on ${day} at ${time}.`;
icon = 'fas fa-ticket';
}
const confirmationInfo = {
title: event.name,
subtitle: "",
info: "",
title: title,
subtitle: subtitle,
icon: icon,
info: info,
url: 'www.tryclubhub.com',
unsubscribeURL: 'www.tryclubhub.com',
club: exports.BuildClubInfo(club)
Expand Down
Loading

0 comments on commit c33b335

Please sign in to comment.