1 | <?php |
||
17 | class AzineEmailOpenTrackingCodeBuilder implements EmailOpenTrackingCodeBuilderInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $tracking_params_campaign_source; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $tracking_params_campaign_medium; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $tracking_params_campaign_content; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $tracking_params_campaign_name; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $tracking_params_campaign_term; |
||
43 | |||
44 | /** |
||
45 | * @var|null |
||
46 | */ |
||
47 | private $trackingUrlTemplate; |
||
48 | |||
49 | /** |
||
50 | * @var string the html-code template |
||
51 | */ |
||
52 | protected $imageHtmlCode = "<img src='%s' style='border:0' alt='' />"; |
||
53 | |||
54 | /** |
||
55 | * @param string $trackingUrlTemplate the url configured in your config.yml or null if you didn't specify a tracking url. |
||
56 | * @param array $parameters array with the parameter names for the campaign tracking |
||
57 | */ |
||
58 | 8 | public function __construct($trackingUrlTemplate, $parameters) |
|
67 | |||
68 | /** |
||
69 | * @param string $templateBaseId the template used for rendering the email (without the .html.twig or .txt.twig extension) |
||
70 | * @param array $campaignParams the campaign-parameters used for this email |
||
71 | * @param string $messageId the id of the message |
||
72 | * @param string $to to-recipient-email(s) or null |
||
73 | * @param string $cc cc-recipient-email(s) or null |
||
74 | * @param string $bcc bcc-recipient-email(s) or null |
||
75 | * |
||
76 | * @return string|null Email open tracking code for google analytics or piwik or null |
||
77 | */ |
||
78 | public function getTrackingImgCode($templateBaseId, array $campaignParams, array $emailTemplateParams, $messageId, $to, $cc, $bcc) |
||
97 | |||
98 | /** |
||
99 | * concatenate all recipients into an array and implode with ';' to a string. |
||
100 | * |
||
101 | * @param string|array $to |
||
102 | * @param string|array $cc |
||
103 | * @param string|array $bcc |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | protected function merge($to, $cc, $bcc) |
||
122 | |||
123 | /** |
||
124 | * Build tracking image code with an URL according to these sources: |
||
125 | * http://dyn.com/blog/tracking-email-opens-via-google-analytics/ |
||
126 | * https://developers.google.com/analytics/devguides/collection/protocol/v1/email#protocol. |
||
127 | * |
||
128 | * @param string $baseUrl string something like: https://www.google-analytics.com/collect?v=1&cm=email&t=event&ec=email&ea=open&tid=TRACKING_ID replace the TRACKING_ID with your google analytics tracking ID. |
||
129 | * @param string $templateBaseId |
||
130 | * @param array $campaignParams |
||
131 | * @param array $emailTemplateParams |
||
132 | * @param string $messageId |
||
133 | * @param string|array $recipients |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | protected function getGoogleAnalyticsUrl($baseUrl, $templateBaseId, array $campaignParams, array $emailTemplateParams, $messageId, $recipients) |
||
150 | |||
151 | /** |
||
152 | * Build tracking image code with an URL according to these sources:. |
||
153 | * |
||
154 | * |
||
155 | * @param string $baseUrl string something like: https://your.host.com/piwik-directory/piwik.php?&rec=1&bots=1&e_c=email&e_a=open&e_v=1&idsite=SITE_ID replace the path to your piwik.php and the SITE_ID according to your needs. |
||
156 | * @param string $templateBaseId string |
||
157 | * @param array $campaignParams |
||
158 | * @param array $emailTemplateParams |
||
159 | * @param string $messageId |
||
160 | * @param string $recipients |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function getPiwikUrl($baseUrl, $templateBaseId, array $campaignParams, array $emailTemplateParams, $messageId, $recipients) |
||
175 | |||
176 | /** |
||
177 | * @param array $campaignParams |
||
178 | * @param string $templateId |
||
179 | * |
||
180 | * @return string if no source-value is defined in the $campaignParams, $templateId will be used |
||
181 | */ |
||
182 | protected function getCampaignSource($campaignParams, $templateId) |
||
190 | |||
191 | /** |
||
192 | * @param array $campaignParams |
||
193 | * |
||
194 | * @return string if no name-value is defined in the $campaignParams, date("y-m-d") will be used |
||
195 | */ |
||
196 | protected function getCampaignName($campaignParams) |
||
204 | } |
||
205 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.