[Rails] Re: Actionmailer Help Needed
On Jul 29, 10:16 am, Jenny Blunt <li...@ruby-forum.com> wrote:
> Hi there Fred
>
> Thanks for your answer.
>
> I'm just getting in a pickle with Actionmailer I have to say :(
>
> Am just trying to send a single email to each user. I need the content
> to list their due tasks.
>
> That's why I was trying to display the found set.
>
Forgetting about actionmailer for a second, you're going about things
slightly backwards. send_reminders is iterating over a set of tasks,
sending an email per task - there's nothing you can do in your mailer
that is going to get that down to one per user.
Your send_reminders method should first be identifying those users
with at least one due task, then iterate over those users. Then you
mailer template can iterate over that user's tasks
You might find it helpful to ditch the actionmailer bit for half an
hour and make a view / controller that would display all this
information (eg one action that displays a list of users with due
tasks and then one action that displays the list of tasks for one such
user). If you can get that going then transplanting it to a mailer
situation should be straightforward
Fred
> Thanks, Jx
>
> --
> Posted viahttp://www.ruby-forum.com/.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home