SilverCart\Model\ShopEmail
base class for emails.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ShopEmail
extends DataObject
{
- // members
- private static array $db = ;
- private static type $has_many = ;
- private static type $many_many = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static string $table_name = 'SilvercartShopEmail';
- private static string $dev_email_recipient = '';
- private static array $email_templates = ;
- private static array $registered_email_templates = ;
- private static array $custom_content_blocks = ;
- private static bool $insert_translation_cms_fields = true;
- private static string $insert_translation_cms_fields_after = 'TemplateName';
- protected static array $style = ;
- // methods
- public string singular_name()
- public string plural_name()
- public string getTitle()
- public array fieldLabels()
- public array summaryFields()
- public FieldList getCMSFields()
- public void requireDefaultRecords()
- public static ShopEmail requireDefaultRecord()
- public bool hasCustomContentBlocks()
- public array getCustomContentBlocks()
- public DBHTMLText|null CustomContent()
- public Page|null PageByIdentifierCode()
- public SiteTree|null getDefaultHomepage()
- public static array get_email_templates()
- public static array get_registered_email_templates()
- public static void register_email_template()
- public static void register_email_templates()
- public static void scan_email_templates()
- public string getSubject()
- public DBHTMLText getAdditionalRecipientsHtmlString()
- public string getTemplateNameTitle()
- public static string get_template_name_title()
- public static bool send()
- public static bool send_email()
- protected static void attachFiles()
- public static string populateTemplate()
- public static string parse()
- public static void add_style()
- public static void add_style_if_not_exists()
- public string getStyle()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $belongs_many_many
—
array
n:m relations - $casting
—
array
Casted properties - $custom_content_blocks
—
array
List of custom email content blocks per email template. - $db
—
array
DB attributes - $dev_email_recipient
—
string
Alternative email address to use as universal recipient in dev mode. - $email_templates
—
array
List of the email templates. - $has_many
—
SilverCart\Model\type
n:1 relations - $insert_translation_cms_fields
—
SilverCart\Model\bool
Determines to insert the translation CMS fields automatically. - $insert_translation_cms_fields_after
—
string
Field name to insert the translation CMS fields after. - $many_many
—
SilverCart\Model\type
n:m relations - $registered_email_templates
—
array
List of the registered email templates. - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels. - $style
—
array
Key value pair of CSS styles to use as inline styles in emails.
Methods
protected
- attachFiles() — Attaches the given files to the given email.
public
- CustomContent() — Returns the custom content for the given $displayPosition.
- PageByIdentifierCode() — Returns the page with the given $identifierCode.
- add_style() — Adds a key value pair of css inline styles to use in an email.
- add_style_if_not_exists() — Adds a key value pair of css inline styles to use in an email.
- fieldLabels() — Returns the field labels.
- getAdditionalRecipientsHtmlString() — Returns the additional email recipients as a html string
- getCMSFields() — input fields for backend manipulation
- getCustomContentBlocks() — Returns whether this ShopEmail has custom content blocks.
- getDefaultHomepage() — Returns the default hoomepage defined by the RootController::default_homepage_link configuration option.
- getStyle() — Returns the style with the given $name key.
- getSubject() — Returns the Subject
- getTemplateNameTitle() — Returns the template name title (i18n).
- getTitle() — Returns the email subject and ID as title to show in backend.
- get_email_templates() — Returns the available email template names.
- get_registered_email_templates() — Returns the registered email templates.
- get_template_name_title() — Returns the template name title (i18n).
- hasCustomContentBlocks() — Returns whether this ShopEmail has custom content blocks.
- parse() — The given $content will be parsed with a reduced variant of the SilverStripe default template parsing engine to get localized email templates. Parsing the template like that keeps other template mechanisms like <% if ... %> or <% control ... %> alive to be parsed on processing the real email sending.
- plural_name() — Returns the translated plural name of the object. If no translation exists the class name will be returned.
- populateTemplate() — populates the template with the defined and called variables
- register_email_template() — Registers an email template.
- register_email_templates() — Registers an array of email templates.
- requireDefaultRecord() — Requires a default record for the given $templateName and $templateTitle.
- requireDefaultRecords() — Requires the default records.
- scan_email_templates() — Scans the file system for default email templates.
- send() — sends email to defined address
- send_email() — Sends the email with the given recipient, subject, content and attachments.
- singular_name() — Returns the translated singular name of the object. If no translation exists the class name will be returned.
- summaryFields() — Get the default summary fields for this object.
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.