Using URL Links to Modify Asana Tasks - webhooks

We are using a read only Asana "Project" to manage our design work. Our design work is organized as Asana Tasks. Each Task represents a different design project. The reason for making it read only is to limit Asana users from accidentally making changes to the project details and to restrict Asana users from creating their own tasks that fall outside of the Task standard structure that we have decided on.
To create these tasks in Asana we are using a combination of Cognito forms and Zapier to create the tasks automatically. Our customer fills out the Cognito form and Zapier automatically populates Asana with the design Task that needs to be completed for that specific customer.
The issue with this setup is that to move the tasks around in Asana to provide the team with "updates", either an Asana user with write privileges needs to do it, or the Asana user needs to fill out a form to make the change, since they only have read privileges. We would prefer to keep it super simple and I have figured out a way to do it using Zapier webhooks.
Because we are using Zapier, I can format URL links in any sort of way I want. I can create a URL link that includes the Asana Task ID and the Asana section that the task needs to be moved to. Using webhooks, a user can click a "Change Section" URL. Clicking this URL will trigger a Zapier Zap action which then will change the Asana Task Section. Just by clicking the link a User can make updates to that task.
My question is fairly basic. Is there a way to stop the URL from opening a page but for the data in the URL to be still passed to Zapier? When a user clicks the link it opens a web page and I don't want that to happen. Or if it happens, could the web page immediately close after opening?

The short answers is "no, it's not possible to click on a zapier link and have the page not open or auto-close" out of the box.
The long answer is a little more involved. I'm assuming your url looks something like https://hooks.zapier.com/hooks/catch/1234/abcd?name=john&cool=true, allowing you to pass "name" and "cool" into Zapier.
To pass that into Zapier, you need to get the contents of that URL, either by loading it in a web browser or calling it with another tool (such as fetch or curl).
If you've got some engineering resources, you could host a very simple HTML page somewhere that could accept data and run some Javascript. It would do something like:
read Zapier webhook url from the querystring (probably worth encoding)
On pageload, run await fetch(thatUrl)
Instruct the user to close the page (which is better UX than the JSON or black response you get from Zapier). I thought JS could close any page, but it turns out window.close() only works if the script opened the page (docs).
So that's an ok workaround.

Related

Gmail - Link to Draft in non-conversation view

I am importing/creating drafts in Gmail using the Gmail API. After creation I'd like to redirect the user to the Gmail UI with the opened Draft in the composer window.
I made it work properly for https://mail.google.com/mail/#drafts?compose=[MESSAGE ID]. Other urls I found here also worked well. Gmail is doing some redirects and eventually the composer window is opened with the draft.
Now my issue:
If the user has not enabled "Conversation view" this will not work at all. The redirect will then result in https://mail.google.com/mail/u/0/#drafts?compose=new and only an empty, new composer window is shown and a new draft is created by the UI.
If I open the draft directly the ID-format is different. https://mail.google.com/mail/u/0/#drafts?compose=hJzgZpSqgLQcCWgZqnlNRzRBfMbjZVnZklzvcFxhQCdwT... and I have no idea if this format can be generated somehow.
Does anybody has an idea or experience to also make it work with this UI setting. How I can force Gmail to load the draft into the composer window?
Thanks in advance.
If you have Email Threading > Conversation View enabled
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox?compose=DRAFT_MESSAGE_ID
If you have disabled the Email Threading > Conversation View option
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
Additional information
The main difference between them is that the first is treated as a conversation while the second example is not.
You can use #drafts instead of #inbox in the URL.
The number after .../mail/u/ is the session you have opened
You can retrieve the DRAFT_MESSAGE_ID by making a request to the API
You can approximately generate the compose ID by yourself, there are some examples out there (not recommended). I strongly recommend you to use the DRAFT_MESSAGE_ID instead.
This appears to still be an issue the one solution I did find was that you can find your draft directly (even though it would be the last draft) and go through multiple accounts by redirecting to
https://accounts.google.com/AccountChooser?authuser={user account}&Email={email account}&continue=https://mail.google.com/mail/#search/rfc822msgid:CAMU-31NcJCVHyGNsAycRKfuS0nMonoaZ6wFMD90Sej996qjuPQ#mail.gmail.com
You need to get your message id toi replace the area from <> from your draft. So you'll have to create the draft first. Get the google message ID, then use that with messages/get to get the Global Message Id (also referred to as message id) and then use that with a search. At this point you'll open a page with a search to a single draft but it will not be opened. Your users will have to click on the one message. Unfortunately there does not seem to be a way to have the good way work for conversation view, and this way work for non.
I tried many different URLS and nothing worked. As noted in the original question, it might work that you could link to the full URL but I see no way to get that. If you spend long enough working with an email you'll even find that ID changes so they aren't even stable within a single day.
Another solution that could work is as explained:
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
But as noted this does not open the draft on the first time you go there. It seems you have to travel to that link 2 times in a row to get the message to appear. I guess you could go to the page maybe inject some javascript to go to the page again but I don't know how to do that.

Phabricator tasks and assignments via Zapier

This seems very niche but I have a working system that I would like to simply add to.
Currently, I've a command in a game I've written call a simple Zapier url. Lets say, https://zapier.com/xxxxxxxx?name=me&message=hello%20there&location=location.
When called, it posts the name, location, and message to a discord channel. I would like this to e extended.
What I would, ideally, need is to figure out how Zapier could create a new task in Phabricator manifest titled something like "Bug 231" with the context including name, location, and message, and put it on a projects workboard under a specific category and assign users to it.
I feel like this is possible but cannot figure out the proper syntax.
Zapier itself can perform extra actions out-of-the-box with "Multi-Step zaps". You could add an action after your Discord step to create a Phabricator task.
But, it looks like there's no Phabricator integration on Zapier. If Phabricator has a web API that allows for task creation, you can plug that into Zapier via either:
a "Webhooks by Zapier" step that makes the request
a "Code by Zapier" step if extra processing is needed
a custom Zapier integration w/ Phabricator if you anticipate wanting more actions than "Create Task"
For those seeking similar, I found a way that worked for me :
1- I used https://www.freeformatter.com/json-formatter.html#ad-output to help me with Phabricator's interesting requirements.
2- I went in to conduit / maniphest.edit and used this JSON in the first field to get my desired curl output : [{"type":"title", "value":"test title"},{"type":"description", "value":"This is the description."},{"type":"projects.set", "value":["PHID-PROJ-4dufje6oug3liomahstg"]}]
I took the curl it gave me and put it in here : https://curl.trillworks.com to turn it in to python.
I put the python in to the Zapier python module, replacing text in several places with the variables that Zapier provides.

Kentico 8.2 Newsletter Link and unsubscribe link

I have created a contact form under Forms with first name, last name, and email that is designed to sign up people for a newsletter. I then created a page so when people click on the link placed on the home page it takes them to a page with the contact form.
Right now when I test the subscribe form out, the data does to to the "back office" where it can be retrieved. However, the information I entered is still in the text fields and, unless you notice the small flash of the web page, one might think nothing happened.
I'd like to know how (or be directed to somewhere in the Kentico 8.2 Documentation) I can make it so that the fields clear and a message appears saying "You have been subscribed to the newsletter." That message can either appear on a separate page on the web site, or send a message to the user email, or both. In the Email Marketing part under the templates there are Subscribe and Unsubscribe templates, but I don't know how to use those.
The other issue is creating an Unsubscribe link. Ideally that will open up to a new page saying "You have been unsubscribed." Kentico 8.2 has an unsubscribe page you can create where the user enters in an email address and then hits the Unsubscribe Request button, but I'd rather not do that. As it stands, I did create a page with that form and tested it, but it doesn't seem to work.
When you edit your form, under general tab, there are settings for what will happen after the form is submitted:
Display Text
Redirect to URL
Clear Form
Continue Editing.
Currently you're using the standard Forms application for something which can be managed through the Newsletter/Email Campaign module. Read the documentation more on how to configure this vs. using the Forms application.
Essentially the steps you will do are:
Create your newsletter following the directions in the linked documentation.
Place a newsletter subscription webpart on your page template and configure it to the newsletter you want them to subscribe to.
Use the out of the box unsubscribe feature to allow users to unsubscribe to your newsletter. No need to add any page to the content tree but you can if you want OR just use the OOTB functionality.
If you follow the documentation you should be able to get it setup properly vs. using an online form.

How to track last login date for IBM Domino web user?

Does IBM Domino track the last login date for web users(UserName/Password and internet certificate)? I know the access logs contains this information but wanted to know if there may be something built into Domino (maybe in Address Book). Trying to come up with a method to disable web accounts that have not accessed a domino server in a specified time period.
Thanks,
Kev
The User Activity area in the Database Properties picks up from the log.nsf, which is where this information is stored. But, typically, the log.nsf will only have a few days' worth of information. When I've had this requirement before, I've manually captured it via a custom login page or an initUser function I've had in applications.
One of the easiest solutions is to trigger an action from a live web page that generates a database.nsf?openagent event.
like:
or
Ideally you've use the openagent to print a content type and a response, but if you don't browsers do pretty well with invalid responses from servers.
inside your "myagent" you will have the users name available to you to write it to a document.
Your next challenge will be in getting the agent to trigger, but, not too often, ideally only on login.
When a user uses a custom login form it submits the username/password and redirection url in POST method. You could change that to ...?openagent&nexturl=/blablabla.nsf
Your tiny little agent would run one and only one time upon login and update a document in a your custom logging database.
That's a developer's solution.
There are also admin solutions. The server does keep track of active web sessions, but, it does not drop them into the log.nsf like it does upon session ending for a notes session. I don't think it would be too much work from an admin standpoint to get that information there are a lot of event triggers available to you. It's just been way too long since I worked on any server that anyone cared about statistics.

mturk on external website

I just had a quick question on making a survey on an external link as a HIT on Amazon Mechanical Turk. If a user completes the survey on the external webpage and submit the survey code on the MTurk interface, how do I, as the requester, guarantee that the user won't do the survey again? As in the user should only do the survey once. So is there a way to only allow the user to click on the survey link only once? Thank you!
Each worker is restricted to completing a HIT only once. Of course, if you setup your survey software to not log each worker's WorkerId, it is possible they might click the link multiple times before completing the HIT.
I recommend logging the WorkerId in your survey sytem. You can take a look at some instructions I've put together here for how to achieve this using JavaScript.
I usually ask each worker to submit their workerID on my hit interface. I use their ID along with some other information to generate their code. So, I can cross-check their amazon mturk responses with responses logged on my server.

Resources