File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,30 @@ public function getBookVariables($id)
322322 return $ this ->handleResult ($ requestResult );
323323 }
324324
325+ /**
326+ * Change varible by user email
327+ *
328+ * @param int $bookID
329+ * @param string $email User email
330+ * @param array $vars User vars in [key=>value] format
331+ * @return stdClass
332+ */
333+ public function updateEmailVariables (int $ bookID , string $ email , array $ vars )
334+ {
335+ if (empty ($ bookID )) {
336+ return $ this ->handleError ('Empty book id ' );
337+ }
338+
339+ $ data = ['email ' => $ email , 'variables ' => []];
340+ foreach ($ vars as $ name => $ val ) {
341+ $ data ['variables ' ][] = ['name ' => $ name , 'value ' => $ val ];
342+ }
343+
344+ $ requestResult = $ this ->sendRequest ('/addressbooks/ ' . $ bookID . '/emails/variable ' , 'POST ' , $ data );
345+
346+ return $ this ->handleResult ($ requestResult );
347+ }
348+
325349 /**
326350 * List email addresses from book
327351 *
You can’t perform that action at this time.
0 commit comments