Postmarkapp使用模板PHP类发送电子邮件

时间:2015-10-29 23:27:36

标签: php api email postmark

我正在尝试使用postmarkapp api在php发送电子邮件,我已设法让它发送普通电子邮件。我已经将类上传到index.php所在的目录,但是'use'函数似乎给了我一个错误,这是我所不知道的。

错误:

Parse error: syntax error, unexpected '.', expecting identifier (T_STRING) in /public_html/index.php on line 5

的index.php

// Import the Postmark Client Class.
use Postmark\Models\PostmarkAttachment;
use Postmark\PostmarkClient\.php;

// Create Client
$client = new PostmarkClient("MY API KEY - CENSORED");

// Make a request
$sendResult = $client->sendEmailWithTemplate(
  "sender@example.com",
  "recipient@example.com", 
  TEMPLATEID-CENSORED,
  [
  "product_name" => "product_name_Value",
  "name" => "name_Value",
  "action_url" => "action_url_Value",
  "username" => "username_Value",
  "sender_name" => "sender_name_Value",
  "product_address_line1" => "product_address_line1_Value",
  "product_address_line2" => "product_address_line2_Value",
]);

同一目录邮戳/我有这个班级(官方班级)

https://github.com/wildbit/postmark-php/tree/master/src/Postmark

感谢您花时间阅读,非常感谢。

1 个答案:

答案 0 :(得分:0)

我认为您需要使用Postmark \ PostmarkClient;'而不是使用Postmark \ PostmarkClient.php;'