2009/6/1 cool <[email protected]>

>
> Jonas,
>  I have tried like this.
>
> //// Controller
>        def create
>            if   @announcement.save!
>                @announcement.urgent
>            end
>       end
>
> ///// Model.rb
>
>  def urgent
>     mail(:urgent_announcement, :subject => "Urgent Announcement for "
> + self.school.school_name)
>  end
>
> def mail(action, params)
>    from = "[email protected]"
>    to = "[email protected]"
>    @cc = Array.new
>    @cc << [email protected]"
>    @cc << "[email protected]"
>
>      PersonMailer.dispatch_and_deliver(action, params.merge(:from =>
> from, :to => to, :cc => @cc ), self )
> end
>      I have tried like this. Its going only for  "To" and its not
> going for CC and Bcc.
>
>     Can we specify cc and bcc in the dispatch_and_deliver ?


Yes - however if my recollection is right about the mailer internals it
doesn't support multiple recipients which is I think where your problem may
be.

Try setting cc to a single email address (as a string) rather than an array
of strings to check this.

If this is indeed the case but you do want to send to multiple recipients,
then the code at:

http://gist.github.com/121364

might help out.  Not tested but it should work if you require it in
the Merb::BootLoader.before_app_loads block in init.rb.

Hope this helps

roovo

-- 
roovoweb.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to