cakephp2x email subject line length - cakephp

I am trying to send an email using CakePHP 2x utility CakeEmail, I am getting all my values dynamically as below-
$Email = new CakeEmail();
$Email->from($from_id);
$Email->to($to_id);
$Email->subject($subject);
$Email->send($body);
Sometimes email is sending without any failure, but sometimes it wont. Finally I found the issue with the subject line length. Whenever my subject line is getting bigger then the email is not sending properly through programmatically. But, whenever my subject is line is less than nearly 75 characters then its working perfectly. So, how can I fix this issue by enlarging subject line length. Normally in gmail there is no restriction of subject length. But programmatically it is not allowing in CakePHP 2x CakeEmail utility.

Do you use SMTP. If not then please send mail using SMTP. and the check.
Please follow the given link bellow.
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html

Got the solution by myself. Simply change the core behavior of Email functionality in Cake Lib. Open \lib\Cake\Network\Email\MailTransport.php and edit line no - 47 as below
$this->_mail($to, str_replace(array("\r","\n"), "", $email->subject()), $message, $headers, $params);
So, the basic change is to remove "New Line" & "Carriage Return" from Subject text. Whenever our subject text becomes more than 75 characters, framework will automatically put new line in the subject text, which wont work while on sending emails.

Related

Send multi-line signature to Metamask via web3js

Checked all the similar questions suggested and couldn't find an answer, unfortunately.
Is there a way to send a multi-line message to metamask via web3.eth.personal.sign as the first parameter? (The problem is how to get multiple lines, not how to actually send a message there)
A more eloquent example of my question can be seen in the image attached. There are multiple paragraphs on separate lines: 'Welcome to OpenSea!', 'Click "Sign" to sign in..." etc.
Thanks a lot!
You can either use \n or use instead of '' or "" when you send the message. The option with takes the spacing in the content into consideration (in js).

Parsley.js Validation Requirement

Good afternoon all! I am looking for some guidance to see if this type of validation is possible. I work for a college and am using a form that pushes to our CRM when complete. I am looking for parsley to only validate the email address field IF they enter their college email address. Is this possible? I am trying to weave out personal email accounts and keep everything uniform with the same email address.
Thanks in advance!
You can do that e.g. by using data-parsley-pattern and defining a pattern that matches only the required mail addresses. The pattern to validate against the mail addresses you mentioned in your comment might look like this:
.*#(mail\.)?walshcollege.edu$
This matches everything that:
Starts with any number (*) of arbitrary characters (.)
Followed by an #
Might be followed by "mail.". The dot is escaped to avoid the special meaning "any character", the question mark means "might be there or not" and the parentheses make the question apply to the complete string.
Ends with walscollege.edu (the $ means the end of the string)
If you also want to make sure that an mail address is inserted you need to add data-parsley-required as Parsley by default does not validate empty fields.
Also keep in mind that Parsley validation is only client side, so you should add validations in the server to really make sure that no wrong mail address is used.

SpelEvaluationException: EL1007E '#' not well managed when trying to develope a dialog answering with 'emails'

I'm writing a Dialog that identifies some required capabilities and provides as output the name and the email of the person having those capabilities.
I wrote a dialog node that provides an output like this: "The person you are looking for is name-surname and the email is xxxxx#yyyy.com" , but if I run it I receive the following error "SpelEvaluationException: EL1007E"
The error disappear when replacing the '#' in the answer with any other character
I also tried to build a context variable containing the email and building the answer using the variable but the error is the same.
Any suggestion?
Thanks
You need to escape the # by adding \\ so it should be x\\#y.com

Phones dialing wrong number from tel-hyperlink

We received a complaint that some visitors to our website are dialing the wrong number to get in contact with us.
Our website has a hyperlink in the following form in the footer:
Call us at 12345678
Note that the "+47" (international code) is NOT displayed visually, it is only included in the hyperlink. But now it turns out a limited number of people (circa one a day) is actually calling a private local number at 47123456. Not many considering the size of our business, but still a major nuisance for the family receiving these calls.
The people calling say they just pressed the link to dial.
Has anybody else had these problems? Is anybody aware of mobile phones that do not properly support the tel hyperlink? Any suggestions for a solution? (Apart from changing our or their phone number, of course.)
There are different ways smart phones pick a telephone number.
some are reading the text of your website - some use the tag
on my first try: I would add the +47 to the displayed telephone number
on my second try (or both together): I would replace +47 with 0047 (its norway - or?)
and before posting i got a third idea: which encoding has the webserver and which encoding has the html / PHP page in sourcecode? Both UTF-8 or something else?
Maybe your server is sending it in a different way than the website is created and somehow some smartphones can't handle it correctly.
The problem here is pretty simple: this is the URL-Encoding.
The + char is an reserved character within the URL and represents an space.
To get an actual + sign replace it with the URL encoded version: %2B
See Links for details:
Wikipedia
W3Scools

DotNetNuke Event Logging format

Using DotNetNuke 5.
I am using the EventLogController along with LogInfo to add custom messages to the event logs in dot net nuke.
Within LogInfo we have a method to Add a Property/Value. I am under the assumption that the Controller.AddLog(logInfo) converts the properties & vlaues into XML using the LogInfo->Serialize method for DNN to store it.
My problem is that I want linebreaks in my message. Is there anyway I can add a newline. "\r\n" wouldn't work, wouldn't work, CDATA escaped wouldn't work. Everything gets escaped through the Log function.
How do I pretty print the log message myself?
Regards, V
Sadly, due to the HTML encoding that is done on all messages, you are going to be out of luck trying to do this in the DNN event Log.
Depending on what/where you are, you have a few options.
You can add them as individual detail lines using properties, see my example below.
You could report on something yourself, using a custom log table or something similar
If you are in the context of a Scheduled Job, you can log to that history, which is NOT escaped.
Examples
Log Properties
objLog = new DotNetNuke.Services.Log.EventLog.LogInfo();
objLog.AddProperty("SecureMyInstall", "Phase 2 Error Processing User Accounts");
objLog.LogTypeKey = DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString();
objLogger.AddLog(objLog);
The content of the logs is displayed as HTML, so you should be able to put <br /> to add line breaks.

Resources