Skip to content
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

Mails styling invite #1654

Merged
merged 17 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
118 changes: 101 additions & 17 deletions app/assets/stylesheets/mailers.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,21 @@
color: #5B34EA;
}

body {
.mail {
align-items: center;
display: flex;
flex-direction: column;
}
.container {
text-align: center;
width: 640px;
font-family: 'Manrope';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 19px;
text-align: center;
color: #777683;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.reset-password-button {
border-radius: 20px;
background: #5B34EA;
text-align: center;
display: inline-block;
.button {
border-radius: 20px;
background: #5B34EA;
text-align: center;
display: inline-block;

a {
a {
width: 129px;
height: 24px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
Expand All @@ -52,11 +44,103 @@ body {
line-height: 16px;
color: #FFFFFF;
text-decoration: none;
display: inline-block;
display: flex;
justify-content: center;
align-items: center;
}
}
.purple {
color: #5B34EA;
}

.container {
text-align: center;
width: 640px;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 19px;
text-align: center;
color: #777683;
width: 640px;
}

.invitation {
.sender_company_container {
display: flex;
margin-top: 40px;
margin-bottom: 40px;
color: #000;

.sender,
.company {
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid #D7DEE5;
border-radius: 16px;
padding: 24px 16px;
margin-left: 16px;
width: 176px;
height: 130px;
justify-content: space-evenly;

img {
padding-bottom: 4px;
}
}
}

.about-miru-container {
background: rgb(235, 239, 242);
width: 640px;
margin-top: 40px;

.about-miru {
width: 560px;
height: 265px;
clip-path: stroke-box;
margin: auto;
margin-top: 40px;

.about-miru-background {
position: absolute;
}

.miru-logo {
position: relative;
height: 400px;
width: 400px;
left: 288px;
top: -60px;
opacity: 20%;
}

.desc {
position: relative;
top: -444px;
left: 24px;
color: #fff;
width: 272px;
font-size: 14px;

.header {
color: #fff;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 800;
font-size: 24px;
line-height: 33px;
}
}
}
}

hr {
margin-top: 40px;
margin-bottom: 24px;
}
}

.footer-container {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
<!DOCTYPE html>
<%= stylesheet_link_tag "application" %>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
</head>
<body style="color:#1D1A31">
<p>Hi <%= @name %>, </p>
<div class="mail invitation">
<img class="background" src=<%= Rails.root.join('public', 'Background.svg') %> alt="background">
<img class="banner" src=<%= Rails.root.join('public', 'Banner.svg') %> alt="banner">
<p class="header">You have been invited to Miru</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved these to assets/images because the public folder is not available to build. Also, use it like this

<%= image_tag "Background.svg", class: "background" %>


<p>We are so delighted to have you onboard. We want to let you know some of the best ways to get up and running on Miru,</p>
<p><%= @sender_details&.[](:name) %> (<%= @sender_details&.[](:email) %>) has invited you to join <%=@company_details&.[](:name) %> team on Miru</p>

<ul>
<li>Send professional invoices instantly</li>
<li>Accept payments from clients seamlessly</li>
<li>Manage your team and track their progress</li>
<li>Track your time and overall expenses with ease</li>
</ul>
<div class='sender_company_container'> 
<div class='sender'>
<img src=<%= @sender_details&.[](:avatar) ? @sender_details&.[](:avatar) : Rails.root.join('public', 'avatar.svg') %> alt="User avatar" height="40px" width="40px">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. check if image is in assets/images if not then move it and use the <%= image_tag %>

<b><%= @sender_details&.[](:name) %></b>
<%= @sender_details&.[](:email) %>
</div>
<div class='company'>
<img src=<%=@company_details&.[](:logo) ?@company_details&.[](:logo) : Rails.root.join('public', 'miru-logo.svg') %> alt="User avatar" height="40px" width="40px">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

<b><%=@company_details&.[](:name) %></b>
<%=@company_details&.[](:employee_count) %> members
</div>
</div>

<p>
Please <%= link_to "click here", invitations_accepts_url(token: @token), target: "_blank" %> to accept the invitation.
<small>(This link will only be valid for 14 days.)</small>
</p>
To get started, set your password by clicking the button below:

<p>Cheers,</p>
<p>Team Miru</p>
<p class="button"><%= link_to 'Join Miru', invitations_accepts_url(token: @token), target: "_blank" %></p>

<hr />

If you don’t know this user or think this was sent by mistake, please flag this request to our team at <a href="mailto:[email protected]" class="purple">[email protected]</a>

<div class="about-miru-container">
<div class="about-miru">
<img class="about-miru-background" src=<%= Rails.root.join('public', 'about-miru-background.svg') %> alt="about-miru-background">
<img class="miru-logo" src=<%= Rails.root.join('public', 'miru-logo.svg') %> alt="miru-logo">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


<div class="desc">
<p class="header">About Miru</p>
<p>Miru is an open-source time-tracking & invoicing tool developed by a team of experienced developers. Using Miru, you can track your time, create and send invoices for those time entries to your clients & received instant payments.</p>
<p class="button"><%= link_to 'Learn More >', 'https://www.miru.so/', target: "_blank" %></p>
</div>
</div>
</div>

<%= render "devise/shared/footer" %>
</body>
</html>
9 changes: 9 additions & 0 deletions public/about-miru-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion spec/mailers/user_invitation_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

it "renders the body" do
expect(mail.body.encoded).to include("to accept the invitation.")
expect(mail.body.encoded).to include("To get started, set your password by clicking the button below")
end
end
end
Loading