Skip to content

add storage_limit_exceeded mail #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: prd-custom_images_dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/travis/addons/billing/mailer/billing_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def subscription_cancellation_requested(receivers, subscription, owner, charge,
mail(from: cancellation_email, to: receivers, subject: subject, template_path: 'billing_mailer')
end

def storage_limit_exceeded(receivers, subscription, owner, _charge, _event, invoice, cc_last_digits)
@subscription = subscription
@custom_images_url = signin_url(owner)
subject = "Travis CI: Storage Limit Exceeded – Additional Charges May Apply"
mail(from: travis_email, to: receivers, subject: subject, template_path: 'billing_mailer')
end

private

def travis_email
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<style type="text/css" media="screen">
body {
min-width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

body, td {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

strong {
display: block;
}

#travis-ci-email-container {
height: 100%;
width: 100%;
padding: 30px;
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-align: center;
color: #333333;
line-height: 1.4;
background-color: #f6f7fa;
background-image: url('https://s3.amazonaws.com/travis-email-assets/billing-background.png');
background-size: 600px 600px;
}

#email-central-container {
font-family: inherit;
width: 500px;
}

#email-content-container {
padding: 6% 7% 5% 7%;
background-color: #FFFFFF;
text-align: center;
width: 100%;
}

#email-content-container p {
font-size: 16px;
margin: 0 0 10px 0;
}

#travis-logo-img-container {
border-bottom: 2px solid #e5e7e9;
padding-bottom: 4.545%;
}

#travis-logo-img {
width: 42%;
}

#storage-limit-exceeded-header {
font-size: 24px;
font-weight: 600;
margin: 10.227% 0 6.818% 0;
}

.green-highlight {
color: #32d282;
}

#email-content-container .button {
display: inline-block;
padding: 12px 15px;
color: #333333;
background-color: #f4f5f9;
font-size: 14px;
line-height: 14px;
margin: 10px 0 10px 0;
border-radius: 5px;
text-decoration: none;
text-transform: uppercase;
font-weight: 600;
}

#email-content-container .button--green {
color: #ffffff;
background-color: #32d282;
}

#closing-message-section {
padding: 10.227% 0 1.136% 0;
}

#closing-message-section > p {
margin: 0;
}

#travis-ci-twitter-section {
text-align: center;
}

#travis-ci-twitter-section a {
display: inline-block;
height: 32px;
vertical-align: bottom;
}

#travis-ci-twitter-section img {
width: 32px;
height: 32px;
}

#travis-ci-email-footer-container {
padding: 10% 7% 0% 7%;
}

#questions-section {
font-size: 18px;
color: #0068FF;
padding-bottom: 10.227%;
}

#questions-section span {
background-color: #f6f7fa;
background-color: rgba(246, 247, 250, 0.8);
}

#questions-section a {
color: #0068FF;
}

#travis-ci-footer-logo-section {
padding-bottom: 6.818%;
text-align: center;
}

#email-footer-section {
font-size: 11px;
color: #9EA3A8;
text-align: center;
padding-top: 0px;
margin: 0px;
}

#email-footer-section a {
color: #9ea3a8;
}

#email-footer-section p {
margin: 0px;
}

#email-footer-section #payment-processor-message {
margin-bottom: 3.409%;
padding: 0 1%;
}
</style>
</head>

<body style="min-width: 100%;height: 100%;margin: 0;padding: 0;font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">

<table id="travis-ci-email-container" align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" style="height: 100%;width: 100%;padding: 30px;font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;text-align: center;color: #333333;line-height: 1.4;background-color: #f6f7fa;background-image: url(#{Travis.config.s3.url}/billing-background.png);background-size: 600px 600px;">
<!-- Main Content Section -->
<tr>
<td align="center" valign="top" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<table id="email-central-container" border="0" cellpadding="0" cellspacing="0" style="font-family: inherit;width: 500px;">
<tr>
<td style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<table id="email-content-container" border="0" cellpadding="0" cellspacing="0" style="padding: 6% 7% 5% 7%;background-color: #FFFFFF;text-align: center;width: 100%;">
<!-- Logo -->
<tr>
<td id="travis-logo-img-container" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;border-bottom: 2px solid #e5e7e9;padding-bottom: 4.545%;">
<img src="#{Travis.config.s3.url}/travis_ci_logo.png" alt="Travis CI Logo" id="travis-logo-img" style="width: 42%;">
</td>
</tr>
<!-- Header - Storage Limit Exceeded -->
<tr>
<td style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<h2 id="storage-limit-exceeded-header" style="font-size: 24px;font-weight: 600;margin: 10.227% 0 6.818% 0;">Storage Limit Exceeded</h2>
</td>
</tr>
<!-- Body text -->
<tr>
<td style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<!-- Basic info -->
<p style="font-size: 16px;margin: 0 0 10px 0;">
Dear <%= @subscription[:first_name] %> <%= @subscription[:last_name] %>,
</p>

<!-- Storage info -->
<p style="font-size: 16px;margin: 0 0 10px 0;">
We wanted to inform you that your storage space limit has been exceeded.
<br>
Depending on your plan details, any excess usage may incur additional charges,
which will be deducted from your credit pool at the end of the current billing cycle.
</p>

<p style="font-size: 16px;margin: 0 0 10px 0;">
You can manage your storage and reduce usage if needed by visiting the following link:
<a href="<%= @custom_images_url %>" style="color: #333333;"><%= @custom_images_url %></a>
</p>

<p style="font-size: 16px;margin: 0 0 10px 0;">
If you have any questions, feel free to contact us.
</p>
</td>
</tr>
<!-- Closing Message Section -->
<tr>
<td id="closing-message-section" align="center" valign="top" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;padding: 10.227% 0 1.136% 0;">
<p style="font-size: 16px;margin: 0;">Happy building!</p>
<p style="font-size: 16px;margin: 0;"><strong style="display: block;">Travis CI</strong></p>
</td>
</tr>
<tr>
<td id="travis-ci-twitter-section" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;text-align: center;">
<a href="http://www.twitter.com/travisci" style="display: inline-block;height: 32px;vertical-align: bottom;">
<img id="travis-ci-twitter-logo" src="#{Travis.config.s3.url}/twitter2x.png" alt="Twitter Logo" style="width: 32px;height: 32px;">
</a>
</td>
</tr>
</table>

<!-- Email Footer Section -->
<table id="travis-ci-email-footer-container" border="0" cellpadding="0" cellspacing="0" style="padding: 10% 7% 0% 7%;">
<tr>
<td id="questions-section" align="center" valign="top" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 18px;color: #0068FF;padding-bottom: 10.227%;">
<span style="background-color: rgba(246, 247, 250, 0.8);">
Have any questions?
<a href="mailto:[email protected]" style="color: #0068FF;">We&rsquo;re here to help.</a>
</span>
</td>
</tr>
<tr>
<td id="travis-ci-footer-logo-section" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;padding-bottom: 6.818%;text-align: center;">
<%= link_to(image_tag("#{Travis.config.s3.url}/TravisCI-Logo-BW.png", alt: 'black and white travis ci logo'), 'https://travis-ci.com')%>
</td>
</tr>
<tr>
<td id="email-footer-section" style="font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 11px;color: #9EA3A8;text-align: center;padding-top: 0px;margin: 0px;">
<p id="payment-processor-message" style="margin: 0px;margin-bottom: 3.409%;padding: 0 1%;">
We use <a href="https://stripe.com" style="color: #9ea3a8;">Stripe Inc.</a>, 3180 18th Street, Suite 100, San Francisco, CA 94110, USA, as our payment partner
</p>
<p style="margin: 0px;">
Travis CI GmbH, Bonner Straße 12, 51379 Leverkusen, Germany | GF/CEO: Randy Jacops |
<span>Contact: <%= link_to('[email protected]', 'mailto:[email protected]', style: 'color: #9EA3A8')%> | Amtsgericht Charlottenburg, Berlin, HRB 108397 | Umsatzsteuer-ID gemäß §27 a Umsatzsteuergesetz:
<% if @subscription[:country] == 'United Kingdom' %>
GB370195891
<% elsif @subscription[:country] == 'Russian Federation' %>
INN 9909575690, KPP 997789001
<% else %>
DE282002648
<% end %>
</span>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>