OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Feature Requests Send email to Case assignee when assignee is changed

This topic contains 26 replies, has 4 voices, and was last updated by  Bhavesh Tailor 7 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #29991

    ianfp
    Participant

    When a Case is assigned, or when the assignee is changed, I want the new assignee to be notified by email.

    So I go to System > Emails > Notification Rules and I start adding a new rule. I choose “Case” as the Entity Name, but it seems the only “dynamic” recipient I can choose is the Case owner — I can’t choose the Case assignee. Furthermore, the only Event Name options I have are “Entity create”, “remove”, and “update” — “Entity change assignee” is not an event option.

    Questions:
    1) Have I correctly understood the limitations of the Notification Rules system, or is there some way to get it to do what I want?

    2) If it cannot do what I want, are there any plans to make it more flexible?

    3) In the meantime, can I add some custom code to do what I need? How would I begin? Can I add an event listener that can identify if the assignee has been changed?

Viewing 15 replies - 1 through 15 (of 26 total)
  • Author
    Replies
  • #29992

    Mike Kudelya
    Participant

    Hi

    You should use processes, for example:

    Don’t forget run:

    #29993

    ianfp
    Participant

    Mike,

    That seems like a great solution. Thanks for your help. I’ll post back once I have a chance to try it out.

    #29994

    Bhavesh Tailor
    Participant

    Hi Mike ,

    I want to create case from embedded web form . If User Exist into our system then it should be save as case other wise it’s save into contact request listing . is this process possible . i did try to create process.yml but i am not able to store value .

    and after this code run app/console oro:process:configuration:load.


    Bhavesh

    #29995

    Mike Kudelya
    Participant

    Hi

    I have created example based on your requirements, but i used Contact instead ContactRequest:

    I show why your process can not work.

    condition check, $contact is empty or not, i think your $contact is not empty because your actions doesn’t executed

    This is wrong path to CaseEntity. Please change it to CaseBundle.

    In this case you are trying set new Case Entity to contactEntityInstance property of Contact Entity. Try to change it to $.contactEntityInstance (case entity will be saved to temporary contactEntityInstance attribute)

    Also you should set subject, status, priority and source.
    If your process is triggering as ‘queued: true’ cron daemon must be run. Please add it to crontab.

    When your entity will be created (in your case it ContactRequest) every time you can see new job on this url /cron/job

    #29996

    Bhavesh Tailor
    Participant

    Hi Mike,

    form this code also i am not able to create case using embedded form . I have crated process.yml under Resources/config/process.yml .
    Is this location is correct or need to create into Resource/config/oro . ?

    after that i have run app/console oro:process:configuration:load.

    I am not sure what should i add into cron tab, you means to say need to add ‘queued: true’ into cron tab

    please suggest me .

    Thank You


    Bhavesh

    #29997

    Mike Kudelya
    Participant

    Hi

    If you have earlier than 2.0 version of orocrm Resources/config/process.yml is correct path for your file, otherwise put it in Resources/config/oro/processes.yml. You should add to crontab this command, in this case your process (create_case) can working on regular basis (for example: when ContactRequest has created, @create_entity action go to queue and when command has been executed it gets all queued actions and create entities on real database)

    #29998

    Bhavesh Tailor
    Participant

    Hi Mike ,

    Thank You for your quick response . Still i am confuse i am not able to create case if user exist . i have save this process.yml into /orocrmdemo/src/XYZ/Bundle/ContactUsBundle/Resources/config/process.yml . i need to create this file into this bundle or embedded bundle .

    as per your instruction i have added code into crontab -e
    */1 * * * * /usr/bin/php /home/ilogix/Workspace/orocrmdemo/app/console –env=prod oro:cron >> /dev/null

    But not get result .


    Bhavesh

    #29999

    Mike Kudelya
    Participant

    Hi

    1. Let’s ensure that your ‘process’ is loaded, does message appear, when you run this command ? If no, your bundle not working.

    process definition: “create_case” – created

    2. Can you show me your process.yml ? Do you change it ?

    Still i am confuse i am not able to create case if user exist

    3. Are we talking about entity UserBundle/Entity/User.php or ContactBundle/Entity/Contact.php? Can you tell me what is ‘user’ and where it located ?

    #30000

    Bhavesh Tailor
    Participant

    Hi Mike ,

    1. While executing command getting this message

    2: I am trying to store Process file inside

    /Workspace/orocrmdemo/src/MarketSnap/Bundle/ContactUsBundle/Resources/config/process.yml

    define path is correct or need to create into

    /home/ilogix/Workspace/orocrmdemo/src/MarketSnap/Bundle/EmbeddedFormBundle/Resources/config/process.yml

    My process.yml

    and as per you instruction i have added code into crontab also

    */1 * * * * /usr/bin/php /home/ilogix/Workspace/orocrmdemo/app/console –env=prod oro:cron >> /dev/null

    3: I want to create case from contact request, if user exist into contact list then case should me created other wise data will be save as contact request .


    Bhavesh

    #30001

    Bhavesh Tailor
    Participant

    Hi Mike ,

    I have created using custom code . but not able to create using process.yml . Please suggest how can i implement because custom code take too much time to save data .

    Thank You


    Bhavesh

    #30002

    Bhavesh Tailor
    Participant

    Hello Mike ,

    I did remove b2b customer field from opportunity thats why into my table orocrm_sales_opportunity customer_id is null. While i trying to edit status,probability etc. then i got error “This value should not be blank.” . While i remove code from

    OroCRM/Bundle/SalesBundle/Resources/config/validation.yml

    customer:
    – Valid: ~
    – NotBlank: ~

    Then I am able to update fields . How can i override this validation.yml for inline edit datagrid

    Is there any way to override OroCRM/Bundle/SalesBundle/Resources/config/validation.yml form our custom bundle . i did try validation_groups into custom folder

    /Workspace/orocrmdemo/src/MarketSnap/Bundle/SalesBundle/Form/Type/OpportunityType.php
    or also try
    /home/ilogix/Workspace/orocrmdemo/src/MarketSnap/Bundle/SalesBundle/Form/Extension/OpportunityTypeExtension.php

    like

    it’s not work for opportunity datagrid inline edit . Please suggest me how can i solve this issue .
    As Per mention into above post while i remove customer constraint from validation.yml and clear the cache it’s work for me but with this constraint i am not able to edit datagrid data .

    Thank You


    Bhavesh

    #30003

    Mike Kudelya
    Participant

    2: I am trying to store Process file inside
    /Workspace/orocrmdemo/src/MarketSnap/Bundle/ContactUsBundle/Resources/config/process.yml

    define path is correct or need to create into
    /home/ilogix/Workspace/orocrmdemo/src/MarketSnap/Bundle/EmbeddedFormBundle/Resources/config/process.yml

    It doesn’t matter how you named your bundle, ContactUsBundle or EmbeddedFormBundle. The most important enable it in src/Custom/Bundle/YourBundle/Resources/config/oro/bundles.yml

    3: I want to create case from contact request, if user exist into contact list then case should me created other wise data will be save as contact request .

    As i understood you have the following flow:

    In contact request form email field is mandatory.

    1. I think you should search contact by email. Something like this “select * from orocrm_contact c where c.email = ’email which user entered'”.

    1.1 Contact has been found – case must be created, ContactRequest is not.

    1.2 Contact hasn’t been found – ContactRequest must be created, case is not.

    Right ?

    #30004

    Mike Kudelya
    Participant

    Is there any way to override OroCRM/Bundle/SalesBundle/Resources/config/validation.yml form our custom bundle

    Yes, set to your custom validation.yml the following yml:

    Further you can override OpportunityType.php – remove ‘customer’ field and set ‘validation_groups’ to ‘CustomValidation’. I think you can do this also in OpportunityTypeExtension.php

    At the moment you can’t change ‘validation_groups’ in inline edition. I suggest you override getForm function with the following code:

    #30005

    celine.barrozo
    Participant

    Hello Mike,

    I work with ianfp and I created the process.yml and added the process you suggested. I also was able to create the process and it now appears on the process list under System > Processes

    However, the email is not being sent when I change the assignee in a sample case. From the sample process.yml you provided I changed the template to one I created and changed the from to a valid email address.

    Could you please let me know what I am doing wrong?

    Thanks,
    Celine

    #30006

    Bhavesh Tailor
    Participant

    Hi Mike ,

    It’s work for me .

    Thank You


    Bhavesh

Viewing 15 replies - 1 through 15 (of 26 total)

The forum ‘OroCRM – Feature Requests’ is closed to new topics and replies.

Back to top