This module makes it easier to send emails with Newsletter2Go's REST API.

Dependencies

  • Mail System (mailsystem)
  • Libraries API (libraries)

Note: For now this module always assumes body is formatted HTML, and sends the
'html' parameter (instead of 'text' parameter). This way
Newsletter2Go can handle transforming the HTML into plaintext.

Configuration

Download the Newsletter2Go PHP class into sites/all/libraries/newsletter2go.

Set the Newsletter2Go API key in settings.php or with variable_set().

    $conf['newsletter2go_key'] = 'wwwwxxxxyyyyzzzzaaabbbbccccdddd';

Other available variables:

API language namespaces the REST requests. Default is German, 'de'.

      $conf['newsletter2go_api_lang'] = 'de';

Debug prevents Newsletter2Go from sending and turns logging to tmp directory
on and off. Defaults to FALSE.

      $conf['newsletter2go_debug'] = FALSE;

If you want Newsletter2GoMailSystem as the site-wide default for sending mail
there are two options.

  1. Change mailsystem config at admin/config/system/mailsystem
  2. mailsystem_set(array(mailsystem_default_id() => 'Newsletter2GoMailSystem'));

Usage

For a NON-PRODUCTION working example see the code in newsletter2go_example.

Excerpt from newsletter2go_example:

  // Set optional Newsletter2Go params.
  $params = array(
    // newsletter_id can be used for tracking in reports.
    'newsletter_id' => NULL,

    // Enables debug mode
    // No emails sent, but API requests logged to sys_get_temp_dir().
    'debug'         => 0,

    // Send date is a UNIX timestamp.
    // Negative or empty will send the email right away.
    // Otherwise will be queued for sending up to a year.
    'send_date'     => -1,

    // If ref is left unset a unique hash will be generated.
    'ref'           => "test_newsletter2go_message",

    // Reply-to can be set here.
    'reply'         => $email_address,

    // En/dis-ables link tracking
    'linktracking'  => 0,

    // En/dis-ables open tracking
    'opentracking'  => 0,
  );

Comments

PA robot’s picture

Status: Needs review » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.