2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

#Rails の ActionMailer で利用するテンプレートのパス・ファイルをデフォルト以外で指定する ( ActionView::MissingTemplate: ))

Last updated at Posted at 2019-12-22

app/view/path/to/directory/file.text.erb を使いたい場合

template_path にディレクトリを
template_name に拡張子を除くファイルを指定すれば良いらしい

わかりにくいな

    mail(
      to: email,
      subject: subject,
      template_path: 'path/to/directory',
      template_name: 'file'
    )

Ref

Action Mailer Basics — Ruby on Rails Guides
https://guides.rubyonrails.org/action_mailer_basics.html

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?