Add " - Copy" to the end of the new mailing name when cloning
authorLars SG <lars@wildsight.ca>
Fri, 16 Apr 2021 21:51:26 +0000 (15:51 -0600)
committerLars SG <lars@wildsight.ca>
Fri, 16 Apr 2021 21:51:26 +0000 (15:51 -0600)
CRM/Mailing/Controller/Send.php

index 305e9cdcce7e405e83dab532bcdb94a973d98a58..cfde095d34a909a470cb3cf8a5af0800d6fde183 100644 (file)
@@ -49,6 +49,10 @@ class CRM_Mailing_Controller_Send extends CRM_Core_Controller {
     }
     if ($mid && !$continue) {
       $clone = civicrm_api3('Mailing', 'clone', ['id' => $mid]);
+      civicrm_api3('Mailing', 'create', [
+        'id' => $clone['id'],
+        'name' => $clone['values'][$clone['id']]['name'] . " - Copy",
+      ]);
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/mailing/' . $clone['id']));
     }
   }