Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
Does SMTP Api support URL as a subval ?
When I include customized URL as a subval, it seems that the API never decode my URL. So instead of http://example.com, my clients are seeing http:\/\/example.com ( they are using Gmail ).
-
Hello,
We do support urls as subvals through the SMTP api. If you are using PHP, there are sometimes issues where the swift mailer library will double escape the /'s, which causes the link to come out as you are seeing it. -
-
Thanks, it was indeed an issue with swift mailer's header class which parse the json-encoded string wrongly, which i have resolved using a hack in swift-mailer source code. Im going to publish the how to on my blog soon :-)
-
-
I'm running into this issue with SwiftMailer as well, may I please have a link to your blog post? Thanks in advance!
-
-
Sorry, i haven't posted anything about it. Here are the commit that fixed the double escaping, we have running this in production for quite some times without any issues.
--- a/app/vendors/swift_mailer/classes/Swift/Mime/Headers/UnstructuredHeader.php
+++ b/app/vendors/swift_mailer/classes/Swift/Mime/Headers/UnstructuredHeader.php
@@ -96,11 +96,13 @@ class Swift_Mime_Headers_UnstructuredHeader
{
if (!$this->getCachedValue())
{
- $this->setCachedValue(
- str_replace('\', '\\', $this->encodeWords(
- $this, $this->_value, -1, $this->getCharset(), $this->getEncoder()
- ))
- );
+ $encodeWords = $this->encodeWords(
+ $this, $this->_value, -1, $this->getCharset(), $this->getEncoder()
+ );
+ /*$this->setCachedValue(
+ str_replace('\', '\\', $encodeWords)
+ );*/
+ $this->setCachedValue($encodeWords);
}
return $this->getCachedValue();
} -
-
Thanks, I actually found another forum where this fix was posted and applied it yesterday. I'm very glad to hear that this fix has not caused you any issues so far.
-
Loading Profile...





