subscriber-trait.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace JFB_Modules\Actions_V2\Mailchimp\Api\traits; |
| 4 | |
| 5 | trait Subscriber_Trait { |
| 6 | |
| 7 | use List_Trait; |
| 8 | |
| 9 | protected $email_address = ''; |
| 10 | |
| 11 | public function set_email_address( string $email_address ) { |
| 12 | $this->email_address = $email_address; |
| 13 | |
| 14 | $this->set_path( |
| 15 | array( |
| 16 | 'email_md5' => md5( strtolower( $this->get_email_address() ) ), |
| 17 | ) |
| 18 | ); |
| 19 | } |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * @return string |
| 24 | */ |
| 25 | public function get_email_address(): string { |
| 26 | return $this->email_address; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |