From f2676815c06128cc435ab761e5787270aa18f6c2 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Tue, 3 Jun 2014 09:01:51 +0300 Subject: [PATCH] MT#5879 Create default invoice email template. Allow null reseller_id for very default email templates, which will be used to create default reseller templates. --- db_scripts/diff/15060.down | 9 +++++++++ db_scripts/diff/15060.up | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 db_scripts/diff/15060.down create mode 100644 db_scripts/diff/15060.up diff --git a/db_scripts/diff/15060.down b/db_scripts/diff/15060.down new file mode 100644 index 00000000..ade73b34 --- /dev/null +++ b/db_scripts/diff/15060.down @@ -0,0 +1,9 @@ +USE billing; + +ALTER TABLE contracts + DROP COLUMN invoice_email_template_id; +ALTER TABLE email_templates modify reseller_id int(11) unsigned not null; + +delete from email_templates where reseller_id is null and name='subscriber_default_email'; +delete from email_templates where reseller_id is null and name='passreset_default_email'; +delete from email_templates where reseller_id is null and name='invoice_default_email'; diff --git a/db_scripts/diff/15060.up b/db_scripts/diff/15060.up new file mode 100644 index 00000000..832705ff --- /dev/null +++ b/db_scripts/diff/15060.up @@ -0,0 +1,34 @@ +USE billing; + +ALTER TABLE contracts + ADD COLUMN invoice_email_template_id int(11) unsigned DEFAULT NULL; +--we will keep very default templates with reseller_id=null to create new reseller templates when create resellers +ALTER TABLE email_templates modify reseller_id int(11) unsigned; + +insert into email_templates (reseller_id,name,from_email,subject,body)values(null,'subscriber_default_email','default@sipwise.com', +'Dear Customer, + +A new subscriber [% subscriber %] has been created for you. + +Your faithful Sipwise system + +-- +This is an automatically generated message. Do not reply.'); +insert into email_templates (reseller_id,name,from_email,subject,body)values(null,'passreset_default_email','default@sipwise.com', +'Dear Customer, + +Please go to [% url %] to set your password and log into your self-care interface. + +Your faithful Sipwise system + +-- +This is an automatically generated message. Do not reply.'); +insert into email_templates (reseller_id,name,from_email,subject,body)values(null,'invoice_default_email','default@sipwise.com', +'Invoice #[%invoice.serial%] | Dear Customer, + +Please find your invoice #[%invoice.serial%] for [%invoice.month%], [%invoice.year%] in attachment of this letter. + +Your faithful Sipwise system + +-- +This is an automatically generated message. Do not reply.');