Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /**
  2. * Retrieve value of a field of an email template
  3. *
  4. * @param string $templateId Name of an email template
  5. * @param string $fieldName Name of a field value of which to return
  6. * @return string
  7. * @throws UnexpectedValueException
  8. */
  9. protected function _getInfo($templateId, $fieldName)
  10. {
  11. $data = $this->_dataStorage->get();
  12. if (!isset($data[$templateId])) {
  13. throw new UnexpectedValueException("Email template '{$templateId}' is not defined.");
  14. }
  15. if (!isset($data[$templateId][$fieldName])) {
  16. throw new UnexpectedValueException(
  17. "Field '{$fieldName}' is not defined for email template '{$templateId}'."
  18. );
  19. }
  20. return $data[$templateId][$fieldName];
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement