Skip to content

Instantly share code, notes, and snippets.

@sugamasao
Last active June 27, 2020 04:25
Show Gist options
  • Save sugamasao/bf7d49a5d46da059237e2eeb9e74d80f to your computer and use it in GitHub Desktop.
Save sugamasao/bf7d49a5d46da059237e2eeb9e74d80f to your computer and use it in GitHub Desktop.
action mailerで場合によってtextだけにしたい&フォーマットによってテンプレートパスを変えたい場合
mail(param) do |format|
format.html { render 'user_mailer/welcome' } unless @text_dake_okuritai
format.text { render 'user_mailer/text/welcome' } # path/to/name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment