/app/model/communication/class-ms-model-communication-info-update.php

  1. <?php 
  2. /** 
  3. * Communication model - info updated. 
  4. * 
  5. * Persisted by parent class MS_Model_CustomPostType. 
  6. * 
  7. * @since 1.0.0 
  8. * @package Membership2 
  9. * @subpackage Model 
  10. */ 
  11. class MS_Model_Communication_Info_Update extends MS_Model_Communication { 
  12.  
  13. /** 
  14. * Communication type. 
  15. * 
  16. * @since 1.0.0 
  17. * @var string The communication type. 
  18. */ 
  19. protected $type = self::COMM_TYPE_INFO_UPDATE; 
  20.  
  21. /** 
  22. * Get communication description. 
  23. * 
  24. * @since 1.0.0 
  25. * @return string The description. 
  26. */ 
  27. public function get_description() { 
  28. return __( 
  29. 'Sent when a member updates any personal information (e.g. credit card, name, address details etc.)', 'membership2' 
  30. ); 
  31.  
  32. /** 
  33. * Communication default communication. 
  34. * 
  35. * @since 1.0.0 
  36. */ 
  37. public function reset_to_default() { 
  38. parent::reset_to_default(); 
  39.  
  40. $this->subject = __( 'Your billing details have been changed.', 'membership2' ); 
  41. $this->message = self::get_default_message(); 
  42. $this->enabled = false; 
  43.  
  44. do_action( 
  45. 'ms_model_communication_reset_to_default_after',  
  46. $this->type,  
  47. $this 
  48. ); 
  49.  
  50. /** 
  51. * Get default email message. 
  52. * 
  53. * @since 1.0.0 
  54. * @return string The email message. 
  55. */ 
  56. public static function get_default_message() { 
  57. $subject = sprintf( 
  58. __( 'Hi %1$s, ', 'membership2' ),  
  59. self::COMM_VAR_USERNAME 
  60. ); 
  61. $body_notice = __( 'This is to confirm that your billing information has been changed.', 'membership2' ); 
  62. $body_account = sprintf( 
  63. __( 'You can review your account details here: %1$s', 'membership2' ),  
  64. self::COMM_VAR_MS_ACCOUNT_PAGE_URL 
  65. ); 
  66.  
  67. $html = sprintf( 
  68. '<h2>%1$s</h2><br /><br />%2$s<br /><br />%3$s',  
  69. $subject,  
  70. $body_notice,  
  71. $body_account 
  72. ); 
  73.  
  74. return apply_filters( 
  75. 'ms_model_communication_info_update_get_default_message',  
  76. $html 
  77. ); 
.