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

Do not use assets & layout on mail. #118

Merged
merged 1 commit into from
May 29, 2018

Conversation

riseshia
Copy link
Contributor

@riseshia riseshia commented May 29, 2018

Background

We are in the trouble with rails 5.1.x, because of kuroko2 try to find application.css on the worker process, works on the other instance which does not have assets.

Proposal

Disable layout on mail, and does not use assets from asset pipeline.

Here is all mail views.

and image will be attached like:

attachments.inline['kuroko-logo-horizontal.jpg'] = Kuroko2::Engine.root.join('app/assets/images/kuroko2/kuroko-logo-horizontal.png').read

As you can see above, all mail views were designed to work well without layout and assets from asset pipeline.
Furthermore, including assets is not working ;) the mail will be rendered like:

<!DOCTYPE html>
<html>
<head>
  <title>Kuroko2</title>
  <link rel=3D"stylesheet" media=3D"all" href=3D"/assets/kuroko2/applicatio
n-digest.css" />
  <script src=3D"/assets/kuroko2/application-digest.js"></script>
</head>
<body>

<!DOCTYPE html>
<html>
<head>
<title>Failed to execute "Redistribute spot services" on Kuroko</title>
<meta charset="UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable" name="viewport" />
</head>
<body>
...skip...
<code>...skip...</code>
</pre>
</body>
</html>

</body>
</html>

Hence, Just let it be intended.

@cookpad/dev-infra Please review this 🕶

It has inline css & was intended.
@riseshia riseshia merged commit 57b340e into cookpad:master May 29, 2018
@riseshia riseshia deleted the disable-mail-layout branch May 29, 2018 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants