Skip to main content
added 2 characters in body
Source Link

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there'sthere are three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there are three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

I've filed an issue, and added the link to it.
Source Link

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent.

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null.

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

I found the exact error, so edited the answer to reflect this and give a suggested fix
Source Link

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps 1: you first select recipients 2: then you write the body of the SMS 3: you schedule the SMS

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step twoone and threetwo the table civicrm_mailing_recipientscivicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts phonenrcontacts' phone numbers. This gets done in the function getRecipientsgetRecipients in CRM/Mailing/BAO/Mailing.phpCRM/Mailing/BAO/Mailing.php, and the phone_id'sphone_ids get set because $mode$mode is set to "sms". But

But after completing step three this function is called again (don't know why?) and $mode$mode is now empty, and the email_id is set instead and phone_id is set to null. 

This results in an empty result from an sql-call in the function deliverdeliver in CRM/Mailing/Bao/MailingJob.phpCRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

I don't know why thisThis second call to getRecipients is made or why $mode is emptyby the second time around.

I know this is not a complete answerfunction create, but it's a very good clue to whats wrongalso in CRM/Mailing/BAO/Mailing.php, and I don't have enough points to comment, so here itit's there $mode is. Lets figure out exactly whats wrong NOT getting set, and filethere's no checking if it's an issue with a patch :) PS: If you need to send SMSes right now you can cheat by scheduling the bulk sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to a few minutes in the future, then choose continue on the scheduled sms at the page with planned and send SMSes gofix that I altered it to step two where you can Edit the SMSthis:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. Now open another tab/Window andWhen the "Send Scheduled SMS"-job is run, the send scheduled SMSes job from there. The bulk sms will be send because the table with recipients is correctly filled at step two and only overwritten with nulls after step threegets sent.

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps 1: you first select recipients 2: then you write the body of the SMS 3: you schedule the SMS

Between step two and three the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts phonenr. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_id's get set because $mode is set to "sms". But after completing step three this function is called again (don't know why?) and $mode is now empty, and the email_id is set instead and phone_id is set to null. This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, and thus there's no one to send to.

I don't know why this second call is made or why $mode is empty the second time around.

I know this is not a complete answer, but it's a very good clue to whats wrong, and I don't have enough points to comment, so here it is. Lets figure out exactly whats wrong, and file an issue with a patch :) PS: If you need to send SMSes right now you can cheat by scheduling the bulk sms to a few minutes in the future, then choose continue on the scheduled sms at the page with planned and send SMSes go to step two where you can Edit the SMS. Now open another tab/Window and run the send scheduled SMSes job from there. The bulk sms will be send because the table with recipients is correctly filled at step two and only overwritten with nulls after step three.

Hi I'm having this exact problem and have done some debugging:

When making a new SMS there's three steps

  1. you first select recipients
  2. then you write the body of the SMS
  3. you schedule the SMS

Between step one and two the table civicrm_mailing_recipients correctly gets filled with email_id set to null and phone_id set with the id of the contacts' phone numbers. This gets done in the function getRecipients in CRM/Mailing/BAO/Mailing.php, and the phone_ids get set because $mode is set to "sms".

But after completing step three this function is called again and $mode is now empty, and the email_id is set instead and phone_id is set to null. 

This results in an empty result from an sql-call in the function deliver in CRM/Mailing/Bao/MailingJob.php, which try to get the recipients, but returns empty because it has a and thus there's no one to send to.

This second call to getRecipients is made by the function create, also in CRM/Mailing/BAO/Mailing.php, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

So to fix that I altered it to this:

  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent.

added 460 characters in body
Source Link
Loading
Source Link
Loading