I am very excited about views_mail and thank you very much for working on it. I know it is brand-new and in development but still I'm hoping to get it to work.

I made a views_mail view but when I attempt to send a mailing I always get "OK to send to 0 recipients?" and no recipients are mailed from my view.

I did not install sched_act because I could not figure out how to get it working in Drupal 5. I was hoping as long as I didn't want to schedule the mailings for the future that it could manage without sched_act. Could this be the problem?

CommentFileSizeAuthor
#1 groupEmailSettings.gif3.67 KBsomebodysysop

Comments

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
StatusFileSize
new3.67 KB

In order to send email to a user using views_mail, the user must have the "Accept e-mail" option checked in his "Group e-mail settings". See attached.

Users who do not have this setting will not be sent e-mail.

Also, in reviewing the code to see what else might cause this, the only potential problem I see is if either the "Recipient name" or "Recipient email" value is empty.

Also, is it a long recipient list? I don't know if there might be an issue with the number of recipients returned.

jody lynn’s picture

Thanks for looking into it. Now I understand the role of the group email settings.

However I think I hunted down the problem. I had allowed pager to be used in the view. As a result, when views_mail_mail_form_submit called views_build_view it was not returning any items. I think it has to do with the relationship between the pager and the limit in that function. I think paging should be ignored during this function so I changed it in line 375 to say that paging is false $items = views_build_view('items', $view, $view->args, 0, $view->limit, $view->page, $view->offset, $view->filters); which seems to have worked.

somebodysysop’s picture

Status: Active » Needs review

Thanks. Making the modification. Will commit soon.

somebodysysop’s picture

Status: Needs review » Fixed

Committed modifications.

somebodysysop’s picture

Status: Fixed » Closed (fixed)
liliplanet’s picture

Hi,

I've had exactly the same problem (warning: Division by zero in /home/mysite/includes/pager.inc on line 73) and then applied the patch above ...

$items = views_build_view('items', $view, $view->args, 0, $view->limit, $view->page, $view->offset, $view->filters);

The problem is that the first list is over 4000 users (thus an impossible load) and only want the user be able to send more than 50 at at time.

So without the pager it does not really do it for me.

Is there a way to fix this please?

Look forward to hearing from you.
Lilian