Skip to content

Commit

Permalink
Use credentials instead of files to define the template
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBarbieri committed Aug 18, 2022
1 parent 668b0d4 commit 071cd76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/mailers/system_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def send_message(options)

if options[:content_type].present?
mail(mail_options) do |format|
format.text { render template } if options[:content_type] == "text/plain"
format.html { render template } if options[:content_type] == "text/html"
format.text { render inline: template } if options[:content_type] == "text/plain"
format.html { render inline: template } if options[:content_type] == "text/html"
end
else
mail(mail_options)
Expand Down
4 changes: 2 additions & 2 deletions app/models/agents/email_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class EmailAgent < Agent
You can provide a `content_type` for the email and specify `text/plain` or `text/html` to be sent.
If you do not specify `content_type`, then the recipient email server will determine the correct rendering.
For more complex message formatting, if you specify a `content_type` then you can also provide an alternate message `template` name. A user-defined
`template` matching the name which must be located in `'../huginn/app/views/system_mailer'` as `<template_name>.html.erb` or `<template_name>.text.erb`.
For more complex message formatting, if you specify a `content_type` then you can also provide an alternate message `template`.
It is best to use the liquid `credential` tag like so `{% credential message_template %}` to define the template format.
Set `expected_receive_period_in_days` to the maximum amount of time that you'd expect to pass between Events being received by this Agent.
MD
Expand Down

0 comments on commit 071cd76

Please sign in to comment.