mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Add logo to email templates
This commit is contained in:
parent
ea9ca1e1c5
commit
cb4e27d4ba
4 changed files with 24 additions and 19 deletions
|
@ -30,12 +30,7 @@ Notifications.allow({
|
|||
});
|
||||
|
||||
createNotification = function(event, properties, userToNotify) {
|
||||
// console.log('adding new notification for:'+getDisplayName(userToNotify)+', for event:'+event);
|
||||
// console.log(userToNotify);
|
||||
// console.log(properties);
|
||||
|
||||
// 1. Store notification in database
|
||||
|
||||
var notification = {
|
||||
timestamp: new Date().getTime(),
|
||||
userId: userToNotify._id,
|
||||
|
@ -45,12 +40,8 @@ createNotification = function(event, properties, userToNotify) {
|
|||
};
|
||||
var newNotificationId=Notifications.insert(notification);
|
||||
|
||||
// 2. Send notification by email
|
||||
|
||||
// 2. Send notification by email (if on server)
|
||||
if(Meteor.isServer && getUserSetting('notifications.replies', false, userToNotify)){
|
||||
// send the notification if notifications are activated,
|
||||
// the notificationsFrequency is set to 1, or if it's undefined (legacy compatibility)
|
||||
// get specific notification content for "email" context
|
||||
notificationEmail = buildEmailNotification(notification);
|
||||
sendEmail(getEmail(userToNotify), notificationEmail.subject, notificationEmail.html);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
buildEmailTemplate = function (htmlContent) {
|
||||
|
||||
var juice = Meteor.require('juice');
|
||||
|
||||
var emailHTML = Handlebars.templates[getTemplate('emailWrapper')]({
|
||||
var emailProperties = {
|
||||
headerColor: getSetting('headerColor'),
|
||||
buttonColor: getSetting('buttonColor'),
|
||||
logo: '',
|
||||
siteName: getSetting('title'),
|
||||
tagline: getSetting('tagline'),
|
||||
siteUrl: getSiteUrl(),
|
||||
body: htmlContent,
|
||||
unsubscribe: '',
|
||||
accountLink: getSiteUrl()+'account',
|
||||
footer: getSetting('emailFooter')
|
||||
});
|
||||
footer: getSetting('emailFooter'),
|
||||
logoUrl: getSetting('logoUrl'),
|
||||
logoHeight: getSetting('logoHeight'),
|
||||
logoWidth: getSetting('logoWidth')
|
||||
}
|
||||
|
||||
var emailHTML = Handlebars.templates[getTemplate('emailWrapper')](emailProperties);
|
||||
|
||||
var inlinedHTML = Async.runSync(function(done) {
|
||||
juice.juiceContent(emailHTML, {
|
||||
|
|
|
@ -2,6 +2,7 @@ getUnsubscribeLink = function(user){
|
|||
return Meteor.absoluteUrl()+'unsubscribe/'+user.email_hash;
|
||||
};
|
||||
|
||||
// given a notification, return the correct subject and html to send an email
|
||||
buildEmailNotification = function (notification) {
|
||||
var subject, template;
|
||||
|
||||
|
|
|
@ -48,14 +48,17 @@
|
|||
}
|
||||
.heading-container{
|
||||
background: {{headerColor}};
|
||||
color: white;
|
||||
font-family: Helvetica, sans-serif;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
border-radius: 3px 3px 0px 0px;
|
||||
}
|
||||
.heading-container, .logo{
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-family: Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}
|
||||
.main-container{
|
||||
line-height: 1.7;
|
||||
background: white;
|
||||
|
@ -103,7 +106,11 @@
|
|||
<table border="0" width="600" cellpadding="0" cellspacing="0" class="container" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td class="heading-container">
|
||||
{{siteName}}
|
||||
{{#if logoUrl}}
|
||||
<img class="logo" src="{{logoUrl}}" height="{{logoHeight}}" width="{{logoWidth}}" alt="{{siteName}}"/>
|
||||
{{else}}
|
||||
{{siteName}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Reference in a new issue