Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Jul 26, 2017 2:56 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: HTML mail template by editing Database
PostPosted: Wed Jan 18, 2012 11:49 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hello all,
As in other thread, all as asking, but no any answer has been givin. I wanted to edit the mail templates to allow my system to send mails in html. So, writting in the mail templates directly as html is not working, as it still sending mails as text.

So, I went into the Database, and in the table cc_templatemail i found a field as messagehtml and the messagetext. All current mails are currently into the messagetext. So, I edit one of them into the messagehtml as html format.

Then I went into ./admin/Public/A2B_entity_mailtemplate.php and edit line 52 as it was:
Quote:
$instance_table_mail = new Table("cc_templatemail","messagetext, fromemail, fromname, subject");


To be as:
Quote:
$instance_table_mail = new Table("cc_templatemail","messagehtml, fromemail, fromname, subject");


And in line 67 where:
Quote:
window.opener.document.getElementById('msg_mail').value = data.messagetext;


to be:
Quote:
window.opener.document.getElementById('msg_mail').value = data.messagehtml;


But, when I'm trying to test it, and send mails from templates, i have:
1. Mails are arriving, but not in correctr Html format as I record them;
2. Large mails are cutted, and I get only 10 lines;

Should I edit something else, or how do it to get my mails template in correct HTML format?

Thank you in advance,


Top
 Profile  
 
 Post subject: Re: HTML mail template by editing Database
PostPosted: Mon Jan 23, 2012 9:56 pm 
Offline

Joined: Thu Apr 21, 2011 5:22 pm
Posts: 106
I have had thesame problem and gave up because :-

1st - A2billing sanitizes input/output from database. This is for security reasons. Some html codes are removed during this sanitization/cleaning.

2nd. Another issue is the string length limitation on the default email encoder in a2billing. With all that html code, you most likely exceed this limitation causing errors.


Top
 Profile  
 
 Post subject: Re: HTML mail template by editing Database
PostPosted: Wed Feb 22, 2012 2:14 am 
Offline

Joined: Mon Apr 14, 2008 8:37 pm
Posts: 356
Location: Canada
Cool. I had requested this a couple of versions ago since I find that it would be a really cool feature. The security however is a totally different story!


Top
 Profile  
 
 Post subject: Re: HTML mail template by editing Database
PostPosted: Thu Feb 23, 2012 3:08 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
cg180759 wrote:
Cool. I had requested this a couple of versions ago since I find that it would be a really cool feature. The security however is a totally different story!


I'm not sure if I understood what do you mean...

Anyway, i was deeply investigating into the mailer.php sources of a2b, but I couldn't find any of this size limitation... !!


Top
 Profile  
 
 Post subject: Re: HTML mail template by editing Database
PostPosted: Sun Sep 16, 2012 9:15 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hello,
As i still interested in bring this issue ahead, and as like always, a2billing community are inactive, I just wanted to share until where I arrived, and maybe someone are interested, and we may figure out this question definitively.

First of all, to handle html codes, the template table have a limit size to 3000, so I upgrade the size by running:

Quote:
ALTER TABLE `cc_templatemail` CHANGE `messagehtml` `messagehtml` VARCHAR( 90000 );


Second, I need to change the pointing code in the core, so after searching for the 'messagetext', i found several results, as:
Quote:
grep -r messagetext


Then to change all this at once, i did a standard find and change command, with:
Quote:
find . -type f -print0 | xargs -0 sed -i 's/messagetext/messagehtml/g'


All my installation are going to handle the HTML mails, in THEORY, but, it's handling the old deprecated html format, when I write for example: (I'm glad to) i get in the mail: (I\'m glad to). Also, the html characteristics are not being written, as:
Quote:
<hr align="justify" width="50" />
>> Not working...
Quote:
<b>Terms& Conditions</b>
>> Being received as: simple text, and no as Bold text...

Also, Images are not being inserted in the html sent mail...

I don't have really deep acknowledge to investigate ahead, if this is a sendmail issue, or where I may figure out this...

Any help or idea, please??


Top
 Profile  
 
 Post subject: Re: HTML mail template by editing Database
PostPosted: Wed May 29, 2013 4:12 pm 
Offline

Joined: Thu Apr 21, 2011 5:22 pm
Posts: 106
it is not good to store HTML tags in database. Because a2billing does a lot of cleaning and sanity scrutiny to avoid injection fraud, trying to store html in the database will not work in a2billing.

What i suggest is create your mail templates as files and just use database as reference.


Top
 Profile  
 
 Post subject: SOLVED: HTML mail template by editing Database
PostPosted: Fri Aug 09, 2013 7:13 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
SOLVED

After really turning, and spending money in develop codes, where developers tried to edit several pages, the misc.php, and others... which we had to drop all lastly due to securit inconvenientes...

The issue here, is, in v.2.0... just when I go inserting the full HTML code, into the messegetxt field in the DB, the mailhandler work like sharm, and all mails are correctly handled in html code, with all characteristics...

BUT, wen open the mail template GUI editor, and try to edit a mail text, it's being inserted wrong from the ./admin//Public/A2B_entity_mailtemplate.php to the DB, and then, then code is wrongly stored, so, it's bad handled by the mailhandler...

This issue is not a real core issue, it's just a bug in the /Public/A2B_entity_mailtemplate.php page... as also, if I go to customers page, and load an existing template, already stored in html, and just send the mail, the html code is properly handled without any issue...

SO, THE DEFINITION, IS THE MAIN SOLUTION, THIS BUG JUST COME FROMT THE /Public/A2B_entity_mailtemplate.php.

FYI,

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group