Exemplo n.º 1
0
 /**
  * Setup the registered email types
  */
 public static function get_email_types()
 {
     if (!is_null(self::$email_types)) {
         return self::$email_types;
     }
     $signup_props = array('label' => __('Signup Emails', 'follow_up_emails'), 'singular_label' => __('Signup Email', 'follow_up_emails'), 'triggers' => array('signup' => __('after user signs up', 'follow_up_emails')), 'durations' => self::$durations, 'short_description' => __('Sign up emails will send to a new user in your store based upon the criteria you define when creating your emails.', 'follow_up_emails'), 'long_description' => __('Sign up emails will send to a new user in your store based upon the criteria you define when creating your emails. Below are the existing Sign up emails set up for your store. Use the priorities to define which emails are most important. These emails are selected first when sending the email to the customer if more than one criteria is met by multiple emails. Only one email is sent out to the customer (unless you enable the Always Send option when creating your emails), so prioritizing the emails for occasions where multiple criteria are met ensures you send the right email to the right customer at the time you choose. <a href="admin.php?page=followup-emails-settings&tab=documentation">Learn More</a>', 'follow_up_emails'));
     $signup = new FUE_Email_Type('signup', $signup_props);
     $manual_props = array('label' => __('Manual Emails', 'follow_up_emails'), 'singular_label' => __('Manual Email', 'follow_up_emails'), 'list_template' => FUE_TEMPLATES_DIR . '/email-list/manual-list.php', 'triggers' => array(), 'durations' => array(), 'short_description' => __('Manual emails allow you to create email templates for you and your team to utilize when you need to send emails immediately to customers or prospective customers. Creating a manual email will allow you to reduce manual entry and duplication when you send emails from your email client, and keep emails consistent. <a href="admin.php?page=followup-emails-settings&tab=documentation">Learn More</a>', 'follow_up_emails'), 'long_description' => __('Manual emails allow you to create email templates for you and your team to utilize when you need to send emails immediately to customers or prospective customers. Creating a manual email will allow you to reduce manual entry and duplication when you send emails from your email client, and keep emails consistent. Below are the existing Manual emails set up for your store. <a href="admin.php?page=followup-emails-settings&tab=documentation">Learn More</a>', 'follow_up_emails'));
     $manual = new FUE_Email_Type('manual', $manual_props);
     $email_types = apply_filters('fue_email_types', array($signup, $manual));
     // sort by priority
     $sorted_email_types = array();
     foreach ($email_types as $key => $type) {
         $sorted_email_types[$type->priority][$key] = $type;
     }
     ksort($sorted_email_types);
     $email_types = array();
     foreach ($sorted_email_types as $priority => $types) {
         foreach ($types as $type) {
             $email_types[$type->id] = $type;
         }
     }
     self::$email_types = $email_types;
     return self::$email_types;
 }