CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Sending a test e-mail using the API
Pages: [1]

Author Topic: Sending a test e-mail using the API  (Read 441 times)

Joris

  • I’m new here
  • *
  • Posts: 9
  • Karma: 1
Sending a test e-mail using the API
October 24, 2015, 03:26:47 am
Hi all,

I'm trying to send a test e-mailing using the api (using civi 4.6.9).

I've successfully created the Mail, the MailingJob and the MailingEventQueue items

Mailing Job
Code: [Select]
        {
            "id": "134",
            "mailing_id": "34",
            "scheduled_date": "2015-10-23 18:30:34",
            "status": "Scheduled",
            "is_test": "1",
            "job_offset": "0",
            "job_limit": "0"
        }

MailingEventQueue
Code: [Select]
        {
            "id": "48",
            "job_id": "134",
            "email_id": "42",
            "contact_id": "43",
            "hash": "6905d565e6253b28"
        }

But the cron job isn't picking up my mailing job. Is this because the cron ignores jobs flagged with is_test=true ?

I've looked into the code a bit and I think that the form starts the test job itself ..

Form/Test.php
Code: [Select]

$testParams['job_id'] = $job->id;
    $isComplete = FALSE;
    while (!$isComplete) {
      $isComplete = CRM_Mailing_BAO_MailingJob::runJobs($testParams);
    }

If so is there a way to start test jobs using the api?

Joris

  • I’m new here
  • *
  • Posts: 9
  • Karma: 1
Re: Sending a test e-mail using the API
October 24, 2015, 03:47:34 am
I just figured out that there is a "send_test" option to the mailing api
Sorry for the post

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Sending a test e-mail using the API

This forum was archived on 2017-11-26.