-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM: Add Send_Email action + create a typical real automation scenario for a business #33424
Conversation
Signed-off-by: cleacos <javacodia@gmail.com>
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Crm plugin:
|
Signed-off-by: cleacos <javacodia@gmail.com>
@@ -140,6 +140,7 @@ protected function register_triggers(): void { | |||
protected function register_conditions(): void { | |||
$conditions = array( | |||
\Automattic\Jetpack\CRM\Automation\Conditions\Contact_Field_Changed::class, | |||
\Automattic\Jetpack\CRM\Automation\Conditions\Contact_Transitional_Status::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a previously-created condition, but perhaps we should rename it to something simple, like Contact_Status_Changed
. Or better yet, remove it, since I assume it's covered already in Contact_Field_Changed
?
projects/plugins/crm/src/automation/commons/actions/email/class-send-generic-email.php
Outdated
Show resolved
Hide resolved
I fixed a few typos in the workflows above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing works as intended, except for triggering a PHP notice on the second workflow (it's a generic message, but it's definitely triggered by us):
Notice: Trying to get property 'ID' of non-object in /wp-includes/link-template.php on line 456
See inline comments as well. I think we should keep the email action generic (as the current class name indicates), but otherwise we need to rename it.
The PHP notice is pre-existing; see Automattic/zero-bs-crm#3357. |
Signed-off-by: cleacos <javacodia@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed some minor changes to comments/strings: ae4f83f
Looks good now!
…o for a business (#33424) * Add Send_Email action to Automation. Signed-off-by: cleacos <javacodia@gmail.com> * changelog * Register Contact_Transitional_Status condition. Signed-off-by: cleacos <javacodia@gmail.com> * Rename Send_Generic_Email to Send_Contact_Email Signed-off-by: cleacos <javacodia@gmail.com> * Tweaks to comments/strings --------- Signed-off-by: cleacos <javacodia@gmail.com> Co-authored-by: tbradsha <32492176+tbradsha@users.noreply.github.com>
…o for a business (#33424) * Add Send_Email action to Automation. Signed-off-by: cleacos <javacodia@gmail.com> * changelog * Register Contact_Transitional_Status condition. Signed-off-by: cleacos <javacodia@gmail.com> * Rename Send_Generic_Email to Send_Contact_Email Signed-off-by: cleacos <javacodia@gmail.com> * Tweaks to comments/strings --------- Signed-off-by: cleacos <javacodia@gmail.com> Co-authored-by: tbradsha <32492176+tbradsha@users.noreply.github.com>
Proposed changes:
With the goal of having a real example, this PR adds a basic Send_Email functionality. Most of the code was extracted from #33219 and updated/adapted in this one.
This is the automation we want to implement:
Lead
, tag it asProspect
.Lead
changes toCustomer
, add theNew Client
tag and remove theProspect
tag. Finally, send a Customer Welcome email with a special offer.And these are the two Automation Workflows required:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Lead
(With name and email). Check that theProspect
tag was applied.Customer
. Check that theProspect
tags was removed and theNew Client
tag was added.