is there any way to send an email template using the sendwithus service? I searched a lot but nothing found.
The documentation is poor.
Any code example? I am using PHP
is there any way to send an email template using the sendwithus service? I searched a lot but nothing found.
The documentation is poor.
Any code example? I am using PHP
You can find the SendWithUs templating documentation here: https://www.sendwithus.com/docs/templating. It explains both the API calls and the formatting you need to use to replace aspects of your templates, which you store inside SendWithUs.
However, you're using PHP and they've created a library just for you to use that also helps with the templating side of things.
Here a simple class to send emails with sendwithus:
<?php
use sendwithus\API;
require_once 'vendor/autoload.php';
class Sendwithus {
const TEST_API_KEY = 'test_api_key_here';
//three examples in the web...just for testing...
const SENDWITHUS_BALLON_PARTY = 'tem_id_1';
const SENDWITHUS_HAPPY_EMAIL = 'tem_id_2';
const SENDWITHUS_ROBOT_WELCOME = 'tem_id_3';
private $api;
public function __construct(){
$options = array(
'DEBUG' => true
);
//login into Sendwithus with API key...
$this->api = new API(self::LIVE_API_KEY, $options);
}
public function send($template_id){
$this->api->send(
$template_id,
array('address' => 'foo@email.com')
);
}
}
//send email...
$sendwithus = new Sendwithus();
$sendwithus->send($sendwithus::SENDWITHUS_BALLON_PARTY);
Hope this can help you
Regards,
Roger