Announcement

Collapse
No announcement yet.

How to CC/BCC in Mass E-Mail?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to CC/BCC in Mass E-Mail?

    We'd like cc recipients in mass e-mails:
    a@b.com, c@d.com etc. are part of the target list selected for the campaign.

    How can we achieve this?

  • #2
    Hello
    Only developing it

    Comment


    • #3
      Since we only need this for a couple of mailings: Any hint where we could place a quick hack in your code?

      Comment


      • #4
        application/Espo/Modules/Crm/Services/MassEmail.php
        processSending or sendQueueItem(!) method

        Comment


        • #5
          Thanks Tanya,

          We've added the following code:

          Code:
          vi crm/application/Espo/Modules/Crm/Services/MassEmail.php
          
                  /*  Add CC */
                  if($massEmail->get('ccAddress')) {
                      $email->set('cc', $massEmail->get('ccAddress'));
                  }
          
          vi crm/application/Espo/Modules/Crm/Resources/metadata/entityDefs/MassEmail.json
          
                  "ccAddress": {
                      "type": "varchar",
                      "trim": true
                  },
                  "ccName": {
                      "type": "varchar"
                  },
          Although cc_address and cc_name were successfully added as fields to DB table mass_email after rebuild, these fields would not show up in #MassEmail/view/

          Any idea what else we need to change?
          Last edited by tobias; 09-21-2017, 12:26 PM.

          Comment


          • #6
            the easiest way is to copy application/Espo/Modules/Crm/Resources/layouts/MassEmail/detail.json to custom/Espo/Custom/Resources/layouts/MassEmail/detail.json and add needed field manually. Clear Cache

            Comment


            • #7
              Works a treat, thanks so much!

              These are our final modifications:

              Code:
              vi crm/application/Espo/Modules/Crm/Services/MassEmail.php
              
                  function getPreparedEmail:
              
                      /*  Add CC */
                      if($massEmail->get('ccAddress')) {
                          $email->set('cc', $massEmail->get('ccAddress'));
                      }
              
                  function sendQueueItem:
              
                      /* Add CC */
                      if ($massEmail->get('ccName')) {
                          $params['ccName'] = $massEmail->get('ccName');
                      }
              
              
              vi crm/application/Espo/Modules/Crm/Resources/metadata/entityDefs/MassEmail.json
              
                      "ccAddress": {
                          "type": "varchar",
                          "trim": true
                      },
                      "ccName": {
                          "type": "varchar"
                      },
              
              mkdir crm/custom/Espo/Custom/Resources/layouts/MassEmail
              cp crm/application/Espo/Modules/Crm/Resources/layouts/MassEmail/detail.json crm/custom/Espo/Custom/Resources/layouts/MassEmail/detail.json
              vi crm/custom/Espo/Custom/Resources/layouts/MassEmail/detail.json
              
                      [
                          {"name": "ccAddress"},
                          {"name": "ccName"}
                      ]
              There's still an issue with adding ccName, which is somehow ignored by Zend Mail. But that's it.

              Comment

              Working...
              X