Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
For header, CC is almost as much as important as To. We need a method for it.
Proposed resolution
Extend interface similar to getTo and MessageTrait implementation.
Let it return multiple.
Later trigger address parsing and return multiple objects.
API changes
New method getCC().
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff-2808559-6-9.txt | 3.89 KB | ModernMantra |
#9 | get_cc-2808559-9.patch | 3.85 KB | ModernMantra |
| |||
#6 | get_cc-2808559-6.patch | 5.4 KB | ModernMantra |
| |||
#4 | get_cc-2808559-4.patch | 10.24 KB | ModernMantra |
| |||
#2 | get_cc-2808559-2.patch | 2.31 KB | ModernMantra |
|
Comments
Comment #2
ModernMantra CreditAttribution: ModernMantra at MD Systems GmbH for MD Systems GmbH commentedComment #3
miro_dietikerNow this part is repeated 3 times in the MessageTrait. You can create a protected helper as a first step.
The standard is asking us to use example.com as example domain...
I already created the variant éxample, we should not add too many more. If you are up for fancy terms, use ANYTHING.example.com
Comment #4
ModernMantra CreditAttribution: ModernMantra at MD Systems GmbH for MD Systems GmbH commentedBy some investigation, IMHO issue create getTo() overlaps with this - reason is that we have repeating code in functions and new helper function (see patch) fixes this issue and another referenced.We can possibly merge getTo() issue so that here we add only API signature. Or maybe i am wrong... :-)
Comment #5
miro_dietikerI only wanted to have this part inside a helper.
Now you create a helper that is still not standing on its own. It contains varying special cases depending on the field it gets.
Plus the return type is mixed, with lying in annotation (you return array sometimes)... breaking autocompletion.
I just wanted to have a method:
Still postponing for the overlap. We don't merge these kind of issues. The overlap would still have been minimal with the intention.
Comment #6
ModernMantra CreditAttribution: ModernMantra at MD Systems GmbH for MD Systems GmbH commentedBy some investigation, i made great mistake and mixed two things that are very related (thus providing here the fies that should be on another issue, that caused 'illusion' of overlap). Uploading 'clean' patch ready for review :). Interdiff too big... Setting needs review, IMHO it has almost nothing of overlap except idea :)
Comment #7
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedWhy these changes? I guess it's a leftover from #2808557: Make getTo() support multiple.
Maybe: "The list of Cc recipients."
getCc
?I guess these are changes related to #2808557: Make getTo() support multiple as well.
No need for parenthesis.
Do we want to support handling of multiple addresses here? Seems that
getCc
is calling it and then casting the result into a single-element array...Edit: This should be a followup in #11685573 #8.1.
// @todo:
Tests Cc recipients.
Can we add one more (IDN) case similarly to
testGetTo()
?Comment #8
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedHighly related issue.
Comment #9
ModernMantra CreditAttribution: ModernMantra at MD Systems GmbH for MD Systems GmbH commentedComment #10
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedI still see lot of stuff mentioned ni #7.
Comment #11
miro_dietikerStill unwanted change.. but i dropped it and committed the new method.
Just "Converts..." - avoid unneeded words. It makes code / documentation lengthy without adding any value.
Big oops: idn_to_utf8 only exists if the php5_intl package is installed.
I added some conditionals so it doesn't die fatal.
And some more refactoring was needed, some extended checks now with the Unit tests.
Comment #13
miro_dietikerCommitted this.
Completely missed that we need to use the method in the twig templates to display the mail.
Extended issue #2809597: Add Field "To" to Mail header display