cookpad / kuroko2

Kuroko2 is a web-based job scheduler / workflow engine.
MIT License
313 stars 72 forks source link

Do not use assets & layout on mail. #118

Closed riseshia closed 6 years ago

riseshia commented 6 years ago

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:

https://github.com/cookpad/kuroko2/blob/43ecd9711f256b4229391e8f244eee7013fc44bb/app/mailers/kuroko2/notifications.rb#L13

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 🕶