[SOLVED]  using ActionMailer::Base.prepend_view_path('./')   and
changing the notifications folder name to notifier

On 4 mar, 16:33, Erwin <[email protected]> wrote:
> I am testing a ruby 1.9.2 script (it'll be run in a cron task
> later...)  in which I am trying to use ActionMailer
> All my files are in a single folder 'joinus_email
>
> - joinus_email
>     joinus_email.rb
>     notifier.rb
>     - notifications
>         joinus_email.html.erb
>         joinus_email.text.erb
>
> running the script joinus_email.rb, (in which I defined the
> ActionMailer::Base.smtp_settings)
> mail = Notifier.joinus_email("[email protected]").deliver
>
> is raising an exception :
> exception: Missing template notifier/joinus_email with
> {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], 
> :locale=>[:en]}
> in view paths
>
> notifier.rb
> class Notifier < ActionMailer::Base
>   default :from => "[email protected]"
>     def joinus_email(destination, coupon)
>       @url  = "http://example.com";
>       mail(:template_path => 'notifications', :to =>
> destination, :subject => "Welcome") do |format|
>         format.html
>         format.text
>       end
>     end
> end
>
> I believe there is something wrong with the :template_path =>
> 'notifications' parameter...
>  I tried a relative path : " ./notifications"   same error raised
> I also tried to define upon initialization :  TEMPLATE_ROOT = "./
> notifications" in the  joinus_email.rb script , same error raised ...
>
> any suggestions ?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to