Comments (21)
Is there code to add multiple recipients, like in PHPMailer? If so, splitting by ,
and foreach
to add the recipients would work.
from symphonycms.
An EmailGateway has _recipients
property which is an array. The setRecipients()
method accepts either a string or an array, but I can't find anywhere in the code where this is actually called!
General::sendEmail()
used to be a straight wrapper for PHPs mail()
function, which did accept comma-delimited addresses. So my guess is that the Email
or EmailGateway
class needs the logic to split the string to populate the recipients array, only I don't know where it should go.
from symphonycms.
It is called dependent on which gateway you're using, but it's very abstract, and difficult to see...
I think the problem is down to the Email Template Filter not splitting your email list before calling the General::sendEmail
function.
Backwards compatibility is definitely broken here, but I'd comfortably guess that it needs to be the Email Template Filter that needs updating, not the core.
from symphonycms.
I'm saying the opposite ;-) If the refactoring of General::sendEmail()
was just that, refactoring, then the signature and functionality should remain exactly the same and only the internals change. So passing a string containing multiple addresses should be supported by General::sendEmail()
API (the Email class should probably handle this).
@michael-e, I think you wrote the majority of the email stuff, could you comment as to where the splitting logic should go?
from symphonycms.
line 133
of `class.emailgateway.php?
from symphonycms.
@nickdunn: The majority of the code was written by @creativedutchmen. I am on holidays in Italy (and unfortunatley a bit boozed at the moment), but I will take a look tomorrow. At the moment I don't remember breaking backwards compatibility of General::sendEmail()
; all I remember is that we made it deprecated.
from symphonycms.
Yeah, but I searched the source for setRecipients
and the function is never actually called anywhere, so I'm not sure how this thing works ;-)
from symphonycms.
Holiday? Boozey? The perfect time for coding!
Thanks anyway mate, will keep looking. Enjoy the hols.
from symphonycms.
Nick, try setting line 343
of class.general.php
to $email->setRecipients($to_email)
and then line 133
of class.emailgateway
to $email = explode(', ', $email)
What does that do?
from symphonycms.
As far as I see at the moment, recipients are set in line 343 of General::sendEmail()
. If you look at any of the gateway classes, they are indeed supposed to be an array.
If you don't make it, I can take a look at it tomorrow! Please double-check that recipients indeed used to be a comma-separated list formerly. (I don't remember this, athe moment — boozed...)
Thanks for your understanding! :-)
from symphonycms.
Have you updated to the latest Email Template Filter @nickdunn? @rowan-lewis has already fixed the Email Template Filter some time ago
from symphonycms.
@nickdunn: Is this problem solved?
from symphonycms.
@nickdunn is off until next week now... lazy sod ;o)
from symphonycms.
I pinched the update from Rowan's Email Template Filter (thanks Brendan) which fixed the issue.
from symphonycms.
So this can be closed? Or is there a greater issue of setRecipients
not working? From the code it looks like setRecipients
expects an array of recipients, so it doesn't actually do the exploding for you. This behaviour is consistent with the rest of Symphony's 'plural' set functions, so I think it's ok tbh
from symphonycms.
Fair enough, so long as it's in the API documentation. I raised this because it's a breaking change (backwards), but if this is the first time it's been raised then maybe it's not so much of a problem.
I still think the setRecipients should do some checking. If the string contains commas or semi-colons then split, perhaps?
from symphonycms.
Yes, I think Nick's suggestion is fair.
If the recipients is not an array, and it does contain spaces then it should
try to explode the string.
2011/7/12 nickdunn <
[email protected]>
Fair enough, so long as it's in the API documentation. I raised this
because it's a breaking change (backwards), but if this is the first time
it's been raised then maybe it's not so much of a problem.I still think the setRecipients should do some checking. If the string
contains commas or semi-colons then split, perhaps?Reply to this email directly or view it on GitHub:
#709 (comment)
Huib Keemink
Creative Dutchmen
tel: 06-14931250
mail: [email protected]
inet: www.creativedutchmen.com
kvk: 09170619
from symphonycms.
Like I suggested.
from symphonycms.
Although spaces make sense in an email sense, it's not instantly obvious, so I'd tend to stick with comma's if we could.
from symphonycms.
I've seen UIs use all three: spaces (Apple Mail), commas (most webmail) and semicolons (Outlook), so there may be an expectation that all three are supported. PHP's mail()
conforms to RFC 2822, which I haven't dared read...
from symphonycms.
But thankfully I think @michael-e and @creativedutchmen are quite well versed in it ;)
EDIT Found it:
3.6.3. Destination address fields
The destination fields of a message consist of three possible fields,
each of the same form: The field name, which is either "To", "Cc", or
"Bcc", followed by a comma-separated list of one or more addresses
(either mailbox or group syntax).
from symphonycms.
Related Issues (20)
- Unable to upload any media HOT 4
- Fatal Error: DatabaseException - SELECT SQL_CACHE- The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0. HOT 6
- Symphony Deprecated Warning: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated HOT 2
- Error installing Symphony 3.0.0 in PHP 7.3.7 HOT 6
- After successful, bare install of 3.0.0, clicking on Preferences -> Trying to access array offset on value of type null error
- Index column size too large. The maximum column size is 767 bytes
- call_user_func() expects parameter 1
- XSS vulnerability HOT 1
- vendor directory missing from 3.0.0 branch HOT 4
- Handle creation is broken in 2.7 HOT 4
- Error updating from 2.6.11 > 2.7.10 HOT 2
- XXE Vulnerability HOT 1
- Another Error updating Symphony 2.7.10 —> 3.0.0 in PHP 7+
- Login button touching password field
- Entries list .actions has no padding - missing body class .page-index
- Spaces missing in different PHP version HOT 3
- A htaccess file in root directory before Symphony CMS install
- Future of Symphony CMS HOT 13
- MySQL v8 Errors HOT 1
- The website is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symphonycms.