Chore: Update mailer to remove hardcoded twitter link (#1103)

This commit is contained in:
Pranav Raj S 2020-07-30 23:58:42 +05:30 committed by GitHub
parent 2b1d445003
commit a16d2c653d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 18 deletions

View file

@ -11,7 +11,7 @@ class WidgetsController < ActionController::Base
private
def set_global_config
@global_config = GlobalConfig.get('LOGO_THUMBNAIL', 'INSTALLATION_NAME', 'WIDGET_BRAND_URL')
@global_config = GlobalConfig.get('LOGO_THUMBNAIL', 'BRAND_NAME', 'WIDGET_BRAND_URL')
end
def set_web_widget

View file

@ -1,6 +1,7 @@
const {
APP_VERSION: appVersion,
CREATE_NEW_ACCOUNT_FROM_DASHBOARD: createNewAccountFromDashboard,
BRAND_NAME: brandName,
INSTALLATION_NAME: installationName,
LOGO_THUMBNAIL: logoThumbnail,
LOGO: logo,
@ -12,6 +13,7 @@ const {
const state = {
appVersion,
createNewAccountFromDashboard,
brandName,
installationName,
logo,
logoThumbnail,

View file

@ -1,18 +1,17 @@
<template>
<a
v-if="globalConfig.brandName"
class="branding"
:href="`${globalConfig.widgetBrandURL}?utm_source=widget_branding`"
rel="noreferrer noopener nofollow"
target="_blank"
>
<img
:alt="globalConfig.installationName"
:src="globalConfig.logoThumbnail"
/>
<img :alt="globalConfig.brandName" :src="globalConfig.logoThumbnail" />
<span>
{{ useInstallationName($t('POWERED_BY'), globalConfig.installationName) }}
{{ useInstallationName($t('POWERED_BY'), globalConfig.brandName) }}
</span>
</a>
<div v-else class="brand--alternative" />
</template>
<script>
@ -58,4 +57,7 @@ export default {
max-height: $space-slab;
}
}
.brand--alternative {
padding: $space-slab;
}
</style>

View file

@ -7,7 +7,7 @@ class ApplicationMailer < ActionMailer::Base
helper :frontend_urls
helper do
def global_config
@global_config ||= GlobalConfig.get('INSTALLATION_NAME', 'BRAND_URL')
@global_config ||= GlobalConfig.get('BRAND_NAME', 'BRAND_URL')
end
end

View file

@ -82,13 +82,6 @@
<meta itemprop="name" content="Confirm Email" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;" />
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<%= yield %>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
&mdash; Team <%= global_config['INSTALLATION_NAME'] %> <br/>
<a href="<%= global_config['BRAND_URL'] %>" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top"><%= global_config['BRAND_URL'] %></a>
</td>
</tr>
</table>
</td>
</tr>
@ -96,10 +89,15 @@
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<% if global_config['INSTALLATION_NAME'] == 'Chatwoot' %>
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top">
Follow <a href="http://twitter.com/chatwootapp" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">@chatwootapp</a> on Twitter.
</td>
<% if global_config['BRAND_NAME'].present? %>
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
Powered by
<a href="<%= global_config['BRAND_URL'] %>" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;" align="center" valign="top">
<%= global_config['BRAND_NAME'] %>
</a>
</td>
</tr>
<% end %>
</tr>
</table>

View file

@ -20,3 +20,5 @@
value:
- name: CREATE_NEW_ACCOUNT_FROM_DASHBOARD
value: false
- name: BRAND_NAME
value: 'Chatwoot'