Passing description from browser in elsa - elsa-workflows

In document workflow, after I reject/approve the document in the mail, I want it to take to the browser where I can add a comment in the comment box and then pass that comment back to the employee through email. How can it be done?
I have tried adding comments in console and pass it through mail.How can it be done in UI designer?

#vahidnaderi is spot-on:
In the workflow from where you send the email containing the approve/reject link(s), have these links point to a custom webpage you create.
This webpage contains 3 fields and a submit button:
A radiolist with an "approve" and "reject" radiobuttons
A "comments" textarea.
A "workflowinstanceid" hidden field that stores the workflow instance ID.
When the form is submitted to your backend application, you trigger a signal ("approve" or "reject") for the appropriate workflow instance ID and provide the comment as input.
Your workflow will resume and the received comment will be available as input to the first activity that comes after the "signal received" activity.
That activity should either be the "send email" activity or a "set variable" activity in case you want access to the received comment later in the workflow.
From the "send email" activity, you can now access the comment you wish to include with the email.
Obviously, you're completely free to do things differently. For example, perhaps you want a separate page for "approve" and another page for "reject".
The key takeaway here is that you provide your own web UI. This web UI then interacts with your application backend (i.e. by submitting a form to a controller), which then interacts with Elsa services to e.g. trigger workflows.

Related

Slack API: Is there a way to determine which user clicked on a button in an interactive message?

I am new to Slack's API, so bear with me. I have a slack button that contains a simple webhook link which, when clicked, updates a record somewhere on my site. However, I need to determine which user clicked the button and send this info back to my site in order to fill out an updated_by field with the user's name. The only way I see to do this is to somehow update the post request body with a variable containing the user's name?
You need to handle interaction with the buttton.
https://api.slack.com/reference/interaction-payloads/block-actions
The payload received contains the SlackId of the user who clicked the button.

Mailchimp API - send update notification for existing subscribers

I have the following workflow using the Mailchimp API:
User is signing up on a form and uses the button "I want to opt in for the newsletter"
The User is posted to the Mailchimp API with status pending and receives a double-opt-in email
The User clicks on the confirm button and his status is changing to ```subscribed``
Now there is a chance, the user is coming back to another form in my app, but clicks again on the button "I want to opt in for the newsletter"
Now I have two possibilities:
My script is checking weather the user already exists on the list, in this case -> ignore and do nothing
My script triggers a Mailchimp "Update Details" Mailing which asks the user to update its details
1st case is easily doable with the Mailchimp API.
2nd case I know is possible via Mailchimp Widgets but I have not found anything in the API docu to trigger this update mailing.
I know about the different status: https://developer.mailchimp.com/documentation/mailchimp/guides/manage-subscribers-with-the-mailchimp-api/ but nothing is reflecting this particular case ("User already subscribed").
I'd like to know how I can do that and how I can trigger an "update details" mailing via the API.
As far as I know and from what it sounds like you've seen as well there isn't a pre-built option or endpoint in place to trigger MC's update profile email.
But because this version of their email is essentially just a link to the existing subscribers list profile, one of the following workarounds might be worth a shot.
1) Use their API automation workflow option to send existing subscribers an email with their update profile link using the merge tag:
*|UPDATE_PROFILE|*
Doc on that Automation API endpoint: https://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/
Doc on update profile: http://kb.mailchimp.com/campaigns/design/add-an-update-profile-link
Alternatively if you'd like to try and serve subscribers their profile link right on your form after your script check in #2 that to could be done after retrieving:
the subscribers unique_email_id
From: https://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#read-get_lists_list_id_members_subscriber_hash
and appending that hashed id to end of the lists specific Update profile URL as the value for e=
Which would lead them to their existing pre-filled update profile form:
E.g: http://mailchimp.{USX}.list-manage.com/profile?u=839fhdd4dd38abf344924fa&id=f29uundc48d&e={unique_email_id}
Your list specific URL sans the e= value can be obtained from using the update profile merge tag in their Campaign builder and using preview or sending yourself a test email.

Is it possible to add a 'pending' subscriber to Mailchimp via the API?

Here's what I'd like to do:
User completes sign up form on my app
My app sends the input data (email address, name, etc) to Mailchimp via the API, but with a status of 'pending'
My app sends an email to the user asking them to confirm their email address (essentially emulating the Mailchimp confirmation email)
User clicks link in confirmation email, which takes them back to a confirmation page in my app
My app updates the user's status in Mailchimp to 'subscribed' via the API
Essentially, I want to emulate Mailchimps standard confirmation process, but sending the emails from my own app.
The part that I don't know how to do (or don't know if it's possible) is the part where I add a new subscriber with a status of 'pending'.
Here's some further info that's not strictly relevant but may be of interest...
Why don't I just use the standard Mailchimp confirmation email?
The confirmation email needs to contain extra info, unique to each user, that Mailchimp will not have access to.
Why don't I collect all the data locally and then send it all to Mailchimp once the user has confirmed their email address?
For reasons I won't go into, the number and type of required fields will be unknown. At the point when the sign up form is displayed, I will request the list of fields from Mailchimp and display the necessary fields. It is possible that, between the time when the user initially completes the form and the time when the user confirms via email, the required fields will have been changed. If I try to submit the previously collected data to Mailchimp after the required fields have been changed, it will cause an error.
So I need to collect and submit all data to Mailchimp at the same time. And then simply 'switch on' that user in Mailchimp once (s)he has confirmed.
I hope I've provided enough info. If not, happy to provide more or clarify any points.
Thanks!
The internal "pending" status is not able to be managed manually like that. You can subscribe them using double opt-in and then later force them onto the "subscribed" list, but you can't stop them from getting MailChimp's own confirmation email.
One possible work-around would be to add an interest group or merge field that is populated by your system once you've confirmed the email address. You'd then create a saved segment for only confirmed users and make sure you only ever send to that segment and never the whole list.
Another possibility, if you use API v3.0 (which is currently only in beta), is to add them to your list as unsubscribed and then switch their status to "subscribed" once you've confirmed them. If you do this, be very careful that you're not re-subscribing users who unsubscribed or you could wind up in trouble.
This workflow is definitely 100% possible in the current (V3) of the API. Just set the "status" field on a member to "pending" and then to "subscribed".

Send a 'click' to Google Analytics from ruby

I'm building an app with some 'mail tracking' feature and want to notify google analytics about a click in a link from ruby.
I've already changed all external links from email to go to my server to be redirected, so I know what and when the user clicked.
I want to send this click just knowing the 'UA-XXXXX' and the clicked url.
Is there a way? Or the best solution is to render a html page and with JS send the click event?
UPDATE: Ok, I've found gabba but don't know how to send an 'click' event.
Generally its better to use the JS api, since it has access to all of the other data that analytics tracks, like the visitor browser/os/geoip and can tie all that to a 'visit'.
If you are embedding links in emails, you might consider using the source/medium/campaign flags in the links.
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1033867
So technically its not tracking the 'clicks' as an event, more like tracking the fact that the user came to your site from that particular email. You could use a separate campaign label if you wanted the individual click granularity. (If, for example you had the same url in the email more than once and you wanted to know whether they clicked the first or second one in the email)

Using a Workflow to auto-populate a form field upon creation in CRM 2011

I would like to have a field automatically be populated with something I define in a workflow. Currently I have the workflow running upon record creation, however the field is only populated AFTER the user saves the record for the first time.
How can I use a workflow to populate that field before the user saves the form?
You can't. Workflows function on the server-side, but you're asking about populating a client-side field before the server is contacted. Moreover, workflows are triggered asynchronously, which by definition means the record has to be created in advance.
You'll need to either attach a JavaScript function to the OnSave event, or trigger the population of the field in a pre-validation or pre-operation .NET plugin. I suppose you could use a Dialog as well, but that would require user input. See the below links for more detail on the differences between plugins, workflows, and dialogs.
Options: Plugin, Workflow or Dialog
Automate Business Processes in Microsoft Dynamics CRM

Resources