CreditmemoIdentity.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Order\Email\Container;
  7. class CreditmemoIdentity extends Container implements IdentityInterface
  8. {
  9. const XML_PATH_EMAIL_COPY_METHOD = 'sales_email/creditmemo/copy_method';
  10. const XML_PATH_EMAIL_COPY_TO = 'sales_email/creditmemo/copy_to';
  11. const XML_PATH_EMAIL_IDENTITY = 'sales_email/creditmemo/identity';
  12. const XML_PATH_EMAIL_GUEST_TEMPLATE = 'sales_email/creditmemo/guest_template';
  13. const XML_PATH_EMAIL_TEMPLATE = 'sales_email/creditmemo/template';
  14. const XML_PATH_EMAIL_ENABLED = 'sales_email/creditmemo/enabled';
  15. /**
  16. * @return bool
  17. */
  18. public function isEnabled()
  19. {
  20. return $this->scopeConfig->isSetFlag(
  21. self::XML_PATH_EMAIL_ENABLED,
  22. \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
  23. $this->getStore()->getStoreId()
  24. );
  25. }
  26. /**
  27. * @return array|bool
  28. */
  29. public function getEmailCopyTo()
  30. {
  31. $data = $this->getConfigValue(self::XML_PATH_EMAIL_COPY_TO, $this->getStore()->getStoreId());
  32. if (!empty($data)) {
  33. return explode(',', $data);
  34. }
  35. return false;
  36. }
  37. /**
  38. * @return mixed
  39. */
  40. public function getCopyMethod()
  41. {
  42. return $this->getConfigValue(self::XML_PATH_EMAIL_COPY_METHOD, $this->getStore()->getStoreId());
  43. }
  44. /**
  45. * @return mixed
  46. */
  47. public function getGuestTemplateId()
  48. {
  49. return $this->getConfigValue(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $this->getStore()->getStoreId());
  50. }
  51. /**
  52. * @return mixed
  53. */
  54. public function getTemplateId()
  55. {
  56. return $this->getConfigValue(self::XML_PATH_EMAIL_TEMPLATE, $this->getStore()->getStoreId());
  57. }
  58. /**
  59. * @return mixed
  60. */
  61. public function getEmailIdentity()
  62. {
  63. return $this->getConfigValue(self::XML_PATH_EMAIL_IDENTITY, $this->getStore()->getStoreId());
  64. }
  65. }