Caldera_Forms_Email_Client

Base class for email API clients.

Defined (1)

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

/classes/email/client.php  
  1. abstract class Caldera_Forms_Email_Client implements Caldera_Forms_Email_Interface { 
  2.  
  3. /** 
  4. * API object 
  5. * @since 1.4.0 
  6. * @var object 
  7. */ 
  8. protected $api; 
  9.  
  10. /** 
  11. * Message details 
  12. * @since 1.4.0 
  13. * @var array 
  14. */ 
  15. protected $message; 
  16.  
  17. /** 
  18. * Message attachments 
  19. * @since 1.4.0 
  20. * @var array 
  21. */ 
  22. protected $attachments; 
  23.  
  24. /** 
  25. * Caldera_Forms_Email_Client constructor. 
  26. * @since 1.4.0 
  27. * @param array $message Message details 
  28. */ 
  29. public function __construct( array $message ) { 
  30. $this->include_sdk(); 
  31.  
  32. $this->message = $message; 
  33.  
  34. $this->prepare_attachments(); 
  35.  
  36.  
  37. /** 
  38. * Create Caldera_Forms_Email_Attachment objects 
  39. * @since 1.4.0 
  40. */ 
  41. public function prepare_attachments() { 
  42. if( ! empty( $this->message[ 'attachments' ] ) ) { 
  43. foreach ( $this->message['attachments'] as $attachment ) { 
  44. $obj = new Caldera_Forms_Email_Attachment( ); 
  45. $obj->content = $attachment; 
  46. $this->attachments[] = $obj; 
  47.  
  48.  
  49.