File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 33namespace MailerLiteApi \Api ;
44
55use MailerLiteApi \Common \ApiAbstract ;
6+ use MailerLiteApi \Exceptions \MailerLiteSdkException ;
67
78/**
89 * Class Campaigns
@@ -18,11 +19,17 @@ class Campaigns extends ApiAbstract {
1819 *
1920 * @param int $campaignId
2021 * @param array $contentData
21- * @param array $params
2222 * @return [type]
2323 */
24- public function addContent ($ campaignId , $ contentData = [], $ params = [] )
24+ public function addContent (int $ campaignId , array $ contentData )
2525 {
26+ if ( ! array_key_exists ('html ' , $ contentData )) {
27+ throw new MailerLiteSdkException ("HTML must be provided " );
28+ }
29+ if ( ! array_key_exists ('plain ' , $ contentData )) {
30+ throw new MailerLiteSdkException ("Plain text must be provided " );
31+ }
32+
2633 $ endpoint = $ this ->endpoint . '/ ' . $ campaignId . '/content ' ;
2734
2835 $ response = $ this ->restClient ->put ($ endpoint , $ contentData );
@@ -64,7 +71,7 @@ public function cancel($campaignId)
6471 /**
6572 * Get collection of items
6673 * @param array $fields
67- * @return [type]
74+ * @return \MailerLiteApi\Common\Collection
6875 */
6976 public function get ($ type = 'sent ' , $ fields = ['* ' ])
7077 {
You can’t perform that action at this time.
0 commit comments