| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\FormMigration\Steps; |
| 4 |
|
| 5 |
use Give\FormMigration\Contracts\FormMigrationStep; |
| 6 |
|
| 7 |
class EmailSettings extends FormMigrationStep |
| 8 |
{ |
| 9 |
public function process() |
| 10 |
{ |
| 11 |
$this->formV3->settings->emailOptionsStatus = $this->formV2->getEmailOptionsStatus(); |
| 12 |
$this->formV3->settings->emailTemplate = $this->formV2->getEmailTemplate(); |
| 13 |
$this->formV3->settings->emailLogo = $this->formV2->getEmailLogo(); |
| 14 |
$this->formV3->settings->emailFromName = $this->formV2->getEmailFromName(); |
| 15 |
$this->formV3->settings->emailFromEmail = $this->formV2->getEmailFromEmail(); |
| 16 |
|
| 17 |
$notifications = \Give_Email_Notifications::get_instance()->get_email_notifications(); |
| 18 |
foreach($notifications as $notification) { |
| 19 |
$this->formV3->settings->emailTemplateOptions[ $notification->config['id'] ] = [ |
| 20 |
'status' => $notification->get_notification_status($this->formV2->id), |
| 21 |
'email_subject' => $notification->get_email_subject($this->formV2->id), |
| 22 |
'email_header' => $notification->get_email_header($this->formV2->id), |
| 23 |
'email_message' => str_replace( |
| 24 |
['"“', '"”', '“"', '”"', '“', '”'], |
| 25 |
'"', |
| 26 |
$notification->get_email_message($this->formV2->id) |
| 27 |
), |
| 28 |
'email_content_type' => $notification->get_email_content_type($this->formV2->id), |
| 29 |
'recipient' => (array) $notification->get_recipient($this->formV2->id) |
| 30 |
]; |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
|