first commit
This commit is contained in:
28
preview-sender.php
Normal file
28
preview-sender.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$to = "holly@jutecreative.com";
|
||||
$files = ["ex-A", "ex-B", "us-version-A", "us-version-B"];
|
||||
|
||||
foreach ($files as $file) {
|
||||
$content = str_replace("\n", "", file_get_contents(__DIR__."/$file.html"));
|
||||
$payload = [
|
||||
"to" => $to,
|
||||
"subject" => "Email Preview: $file",
|
||||
"message" => $content,
|
||||
"secret" => "YyyYyHgy765765757yyyyYYYy0Wm08p4bT(qwyRGq",
|
||||
];
|
||||
|
||||
$url = "https://sendmail.ofco.cloud/send-email";
|
||||
$c = curl_init($url);
|
||||
curl_setopt($c, CURLOPT_HEADER, false);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($c, CURLOPT_HTTPHEADER, ["Content-type: application/json"]);
|
||||
curl_setopt($c, CURLOPT_POST, true);
|
||||
curl_setopt($c, CURLOPT_POSTFIELDS, json_encode($payload));
|
||||
|
||||
$json_response = curl_exec($c);
|
||||
curl_close($c);
|
||||
|
||||
$res = json_decode($json_response);
|
||||
var_dump($res);
|
||||
}
|
||||
Reference in New Issue
Block a user