MS_Model_Communication_Info_Update

Communication model - info updated.

Defined (1)

The class is defined in the following location(s).

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