| @@ -35,8 +35,18 @@ | ||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | do_action( 'yaymail_register_elements', $this ); |
| 39 | + | |
| 40 | + $emails = yaymail_get_emails(); | |
| 41 | + | |
| 42 | + foreach ( $this->elements as $element ) { | |
| 43 | + foreach ( $emails as $email ) { | |
| 44 | + if ( $element->is_available_in_email( $email ) ) { | |
| 45 | + $email->register_element( $element ); | |
| 46 | + } | |
| 47 | + } | |
| 48 | + } | |
| 39 | 49 | } |
| 40 | 50 | |
| 41 | 51 | public function register_element( $element ) { |
| 42 | 52 | if ( ! ( $element instanceof BaseElement ) ) { |