crater icon indicating copy to clipboard operation
crater copied to clipboard

Ability to CC another email address

Open adampatterson opened this issue 3 years ago • 11 comments

I have some clients that request to be CC'd or at least have two people receive the invoice. Currently, I have to send to the customer, then copy the invoice URL and manually email.

If I could add multiple emails and separate them with a comma that would solve my issue.

adampatterson avatar Nov 23 '20 21:11 adampatterson

+1 on the feature request

azaricstefan avatar Dec 04 '20 11:12 azaricstefan

Good idea! we've started working on this 👍

mohitpanjwani avatar Dec 07 '20 13:12 mohitpanjwani

Is this something coming soon?

dfanica avatar Jul 01 '21 09:07 dfanica

@mohitpanjwani is there an update on this?

azaricstefan avatar Aug 09 '21 14:08 azaricstefan

I think I will go ahead and create a PR for this feature.

dfanica avatar Aug 09 '21 15:08 dfanica

@dfanica did you create the PR?

azaricstefan avatar Dec 07 '21 01:12 azaricstefan

@dfanica did you create the PR?

I was waiting for the latest changes before I look into this it... I will do it this weekend

dfanica avatar Dec 07 '21 08:12 dfanica

I had a stab at this over the weekend but doing it properly would require a little more time than I'm willing to put in for this so opted for a quick hack instead.

Since all I really need is to add 1 or 2 emails to the CC for the send invoice I've opted for adding a new method in /app/Mail/SendInvoiceMail.php

    private function getCC($customer)
    {
        switch ($customer['email']) {
            case 'customer_1_email@which_is_unique.com':
                return [
                    '[email protected]',
                    '[email protected]'
                ];
                break;

            case 'customer_2_email@which_is_unique.com':
                return [
                    '[email protected]',
                    '[email protected]'
                ];
                break;
        }
        return false;
    }

And all is really needed is calling it before the return from the build method.

    public function build()
    {
        ...

        if ($cc = $this->getCC($this->data['customer'])) {
            $mailContent->cc($cc);
        }
        return $mailContent;
    }

Good luck guys, and I hope someone will implement it properly. If I get some time at some point, I will myself. I was thinking of using the custom fields to store the CC emails since you can create records per customer. A bit messy but can be accomplished. A new table that holds these emails with a type being cc or bcc, for extra flexibility, and matched by customer email, since it's unique, or id would be better.

dfanica avatar Dec 13 '21 23:12 dfanica

@mohitpanjwani Any updates?

Joonas12334 avatar Mar 10 '22 22:03 Joonas12334

+1 on bcc feature request

leonidas-o avatar Aug 12 '22 18:08 leonidas-o

+1 on this please

ptmplop avatar May 18 '23 06:05 ptmplop