28 if ($this->optionManager->getOption(
'enable_templates_stub',
'N') ===
'Y')
31 return $result->setData($templates);
34 $subjectList = [$subject];
37 $subjectList = $this->optionManager->getOption(
'sender_id', []);
40 $verifiedSubjectIdResult = $this->getVerifiedSubjectIdList($subjectList);
41 if (!$verifiedSubjectIdResult->isSuccess())
43 return $verifiedSubjectIdResult;
46 $verifiedSubjectIdList = $verifiedSubjectIdResult->getData();
49 foreach ($verifiedSubjectIdList as $subjectId)
52 'subjectId' => $subjectId
55 $templatesRequestResult =
58 if ($templatesRequestResult->isSuccess())
60 $templates = array_merge($templates, $templatesRequestResult->getData());
65 if ($checkErrors->isSuccess())
69 $result->setData($templates);
73 $result->addErrors($checkErrors->getErrors());
126 'name' =>
'only text',
127 'channelType' =>
'whatsapp',
130 'attachment' =>
null,
134 'text' =>
"Hello! Welcome to our platform.",
138 'category' =>
'ACCOUNT_UPDATE',
139 'status' => Providers\Edna\Constants\TemplateStatus::PENDING,
141 'type' =>
'OPERATOR',
142 'createdAt' =>
'2021-07-15T14:16:54.417024Z',
143 'updatedAt' =>
'2021-07-16T13:08:26.275414Z',
147 'name' =>
'text + header + footer',
148 'channelType' =>
'whatsapp',
151 'attachment' =>
null,
155 'text' =>
'Greetings',
157 'text' =>
'Hello! Welcome to our platform.',
159 'text' =>
'Have a nice day',
163 'category' =>
'ACCOUNT_UPDATE',
164 'status' => Providers\Edna\Constants\TemplateStatus::APPROVED,
167 'createdAt' =>
'2021-07-20T09:21:42.444454Z',
168 'updatedAt' =>
'2021-07-20T09:21:42.444454Z',
172 'name' =>
'text + buttons',
173 'channelType' =>
'whatsapp',
176 'attachment' =>
null,
180 'text' =>
"Hello! Welcome to our platform. Have you already tried it?",
188 'buttonType' =>
"QUICK_REPLY",
193 'buttonType' =>
"QUICK_REPLY",
202 'category' =>
'ACCOUNT_UPDATE',
203 'status' => Providers\Edna\Constants\TemplateStatus::APPROVED,
206 'createdAt' =>
'2021-07-20T09:21:42.444454Z',
207 'updatedAt' =>
'2021-07-20T09:21:42.444454Z',
211 'name' =>
'text + button-link',
212 'channelType' =>
'whatsapp',
215 'attachment' =>
null,
219 'text' =>
'Hello! Welcome to our platform. Follow the link bellow to read manuals:',
227 'buttonType' =>
"URL",
228 'url' =>
"https://docs.edna.io/"
235 'category' =>
'ACCOUNT_UPDATE',
236 'status' => Providers\Edna\Constants\TemplateStatus::DISABLED,
239 'createdAt' =>
'2021-07-20T09:21:42.444454Z',
240 'updatedAt' =>
'2021-07-20T09:21:42.444454Z',