Send a mail on specific condition

Comments

6 comments

  • Avatar
    Jonathan Hsu

    Hi Simone,

    That should be possible by using a page-level JavaScript function. How many email addresses are there and do you have the conditions for each? You don't need to post specific details like the actual email addresses but I'm curious about the complexity of the decision-making needed in the function.

    0
    Comment actions Permalink
  • Avatar
    Simone Libera

    Hi,

    fist thx for your reply.

    We are talking about 10 mail address as max.

    Do you have some syntax example I can put in the page-level JavaScript?

    Thx

    0
    Comment actions Permalink
  • Avatar
    Jonathan Hsu

    Simone,

    Say you have a date element and you want to send to one of email address if it is before today and another if it is after. Your function could look something like:

    function pickEmail(d) {
    var today = new Date();
    if(today < d) {
    return "email_one@mail.com";
    } else {
    return "email_two@mail.com";
    }
    }

    Then in the dynamic value of the Email Element you would enter

    pickEmail(date_dcn)

    Where date_dcn is the data-column name of the Date element.

    0
    Comment actions Permalink
  • Avatar
    Simone Libera

    Thanks Jonathan.

    I guess code will be triggered only when the page/form is actually open. Is there any possibility to have a "trigger" fired by server side condition?

     

    Thanks again for your help, really appreciated!

    Cheers

    SL

    0
    Comment actions Permalink
  • Avatar
    Jonathan Hsu

    Simone,

    The app functions as being client-side by nature; however, there are possibilities to integrate and develop server-side solutions. So far it sounds like you would be able to handle your needs natively client-side in the app, but I'm guessing the email criteria/conditions are a bit more complex. Do you have any other details that can help me understand your challenges more?

    0
    Comment actions Permalink
  • Avatar
    Simone Libera

    Thx Jonathan, so far we are really at initial stage, so we are just discussing generally.

    Clearly those kind of imlementation can be done via appropriate MW using iForm API: we are just wondering what is available by glance inside iForm.


    Thanks a lot

    Regs

    SL

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk