Copy recipient sending email for only one cc

I’m using the Send an Email module. The emails I want to send have two or more ‘cc’ or copy recipient (that means I need to send the email for at least three people).

But it is just sending to one cc (the first email on copy). Does anyone know how to put everyone in copy?

You need to toggle ON the Map on the Copy Recipient field, not insert in the Email Address 1 field, which only accepts a single email.


It is still returning this error:

Validation failed for 1 parameter(s).
** Invalid email address in parameter ‘cc’.**

What is the value of module 2?

When asking questions about variables, please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

[
    {
        "date": "2024-08-13T19:33:55.000Z",
        "id": 185,
        "size": 1141,
        "headersList": [
            {
                "key": "mime-version",
                "value": [
                    "1.0"
                ]
            },
            {
                "key": "date",
                "value": [
                    "Tue, 13 Aug 2024 16:33:55 -0300"
                ]
            },
            {
                "key": "message-id",
                "value": [
                    "<CAMRtOeL1Co0x2L6LpMhcFPtEbf4zQ22=ux02MJEco1hsvGunrg@mail.gmail.com>"
                ]
            },
            {
                "key": "subject",
                "value": [
                    "Teste - cc3"
                ]
            },
            {
                "key": "from",
                "value": [
                    "Rodrigo Demarchi Martins <martins@domo.vc>"
                ]
            },
            {
                "key": "to",
                "value": [
                    "dema.dido090604@gmail.com"
                ]
            },
            {
                "key": "cc",
                "value": [
                    "Rodrigo Demarchi Martins <rodrigo.demartins@hotmail.com>, dema.dido@faculdadefia.edu.br"
                ]
            },
            {
                "key": "content-type",
                "value": [
                    "multipart/alternative; boundary=\"000000000000a4159b061f95b022\""
                ]
            }
        ],
        "headers": {
            "mime-version": [
                "1.0"
            ],
            "date": [
                "Tue, 13 Aug 2024 16:33:55 -0300"
            ],
            "message-id": [
                "<CAMRtOeL1Co0x2L6LpMhcFPtEbf4zQ22=ux02MJEco1hsvGunrg@mail.gmail.com>"
            ],
            "subject": [
                "Teste - cc3"
            ],
            "from": [
                "Rodrigo Demarchi Martins <martins@domo.vc>"
            ],
            "to": [
                "dema.dido090604@gmail.com"
            ],
            "cc": [
                "Rodrigo Demarchi Martins <rodrigo.demartins@hotmail.com>, dema.dido@faculdadefia.edu.br"
            ],
            "content-type": [
                "multipart/alternative; boundary=\"000000000000a4159b061f95b022\""
            ]
        },
        "subject": "Teste - cc3",
        "from": {
            "address": "martins@domo.vc",
            "name": "Rodrigo Demarchi Martins"
        },
        "to": {
            "address": "dema.dido090604@gmail.com",
            "name": ""
        },
        "cc": {
            "address": "rodrigo.demartins@hotmail.com",
            "name": "Rodrigo Demarchi Martins"
        },
        "bcc": null,
        "text": "Abs,\nRodrigo Martins\nDOMO.VC <https://domo.vc/>\n+55 11 97717-9227\n*martins@domo.vc <martins@domo.vc>*\n",
        "html": "<div dir=\"ltr\"><br clear=\"all\"><div><div dir=\"ltr\" class=\"gmail_signature\" data-smartmail=\"gmail_signature\"><div dir=\"ltr\">Abs,<br>Rodrigo Martins<br><a href=\"https://domo.vc/\" target=\"_blank\">DOMO.VC</a><br>+55 11 97717-9227<br><b><a href=\"mailto:martins@domo.vc\" target=\"_blank\">martins@domo.vc</a></b><div><b><br></b></div></div></div></div></div>\n",
        "references": null,
        "inReplyTo": null,
        "priority": null,
        "attachments": [],
        "folder": "Enviados"
    }
]

Above is the output of the first module. The second one is returning an error so there is no output result/code

Below is the modules




I got just the solution for you. The issue was that the CCs are in a single comma-separated variable in an array.

You can use the built-in function replace with this Pattern (regular expression):

(?:[^>]*?<|>(?:,?\s*|$))

e.g.:

{{split(replace(2.headers.cc[]; "/(?:[^>]*?<|>(?:,?\s*|$))/g"; "|"); "|")}}

Proof https://regex101.com/r/lMIh6P/1

Screenshot

Screenshot_2024-08-15_130845

Output

Screenshot_2024-08-15_130835

Then you can map this directly in the CC field:

Screenshot_2024-08-15_130834


For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{"subflows":[{"flow":[{"id":125,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"cc_array","scope":"roundtrip","value":"{{split(replace(2.headers.cc[]; \"/(?:[^>]*?<|>(?:,?\\s*|$))/g\"; \"|\"); \"|\")}}"},"metadata":{"designer":{"x":1959,"y":21,"name":"Build CC Email Array"}}}]}],"metadata":{"version":1}}

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like

It worked! Tks, Sam :facepunch:

1 Like