subscription service - email sending - xpages

Am looking for some help in a subscription service email sending from domino using Xpages.
scenario : Paul Goodman is a building contractor and he would like to subscribe to his category named "Buildings and Road”.
When someone asks question about his category "Buildings and Road” he and everyone else that have the same subscription , should get email. I have a LS Agent that goes thought a view to send these emails but I would like
to have his done as soon as the message is saved and it has to send one at the time to void spam filters. I know I could execute the LS agent onSave but do you see another solution maybe with JavaScript ? I have only seen some .NET & PHP solutions here.

You have a series of options here:
Extract your logic into a LS library, so it can be used by several agents. Then have on that runs on save (and another one on a new subscription)
Use a DOTs task to listen to documents save - you can write your logic in Java then
Call an ?OpenAgent URL from your client side JavaScript
Put it into your XPage for new articles
Since you have the agent already, I'd go with the first one

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.

Using URL Links to Modify Asana Tasks

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.

Twilio SMS with links - links being clicked automatically?

I have an app that sends SMS's out to a bunch of people. Those messages contain links. They are not using any link shorteners or any other service. They link back to my site. The links themselves are randomized strings, which are stored in my db, which are associated with an action. (Click "yes" or "no" link and the db tracks what you chose.) For ALL users, this works perfectly. With one user - and it's always the same user, as soon as the cron job runs, which triggers this event, his "vote" comes in. This is without him clicking or even seeing the message sometimes.
So, the question: has anyone ever seen or heard of a cell provider or a messaging app or similar that "clicks" links as part of some process before sharing the content with the user? I can't see ANYTHING in the code that would single him out so I'm thinking it has to be something in between when the message goes out and he does what he does. Especially because the timestamp is also always within seconds of the cron job running.
Sending an SMS can sometimes go through multiple carriers before reaching an end destination. As such, providers may be "handling" the content in this case.
The best thing to do would for any cases of this in the future would be to write support for further investigation.

automation of tasks - email using web application

I have a web application that monitors farms in certain areas. Right now I am having a problem of performing automation with some of the tasks.
Users of the web application can send reports or checkins using keywords. If the reports or checkins correspond to certain keywords, for example "alert", I need the web application to send an alert to the user via email using that web application. But that alert must be sent two weeks after the date of the report received, and to that particular user only.
Would it be possible to use cron to perform this? If not, can anyone suggest me a workaround?
A possible approach you might consider is to store an entry in a database for each of these reminder emails you need to send, at the time your user does whatever action in your application that determines the need to send that email exists. Include the recipient, the date to be sent, and the email content as content you store for each entry. Schedule a single cron job to run periodically to process these database records by due date, and populate an email template to be sent out. You can then either delete the database records, or a better option, include a column that indicates they were sent and mark them as sent.
It would help to provide which technology stack you're operating on and what the application is developed in. Others might be able to point you to technology specific approaches or pre-built plugins/extensions that already do this for the situation you're in, to help you avoid the need to write your own code for the solution.

Script to check whether all mails replied in Lotus Notes

We use Lotusnotes 6.5 as email client. We wil have around 1600+ mails for 9 hrs. If a mail not checked , we have face serious issues with our client. Can any script can be written to check whether all mails are checked and replied?
Update:
We have already tried moving the mails to another folder.But has this mailbox handled by team of persons, we noticed lot of human error happening like moving a unread mail, sometimes they would have read mail but forget to reply it etc.etc.
So I was looking out for a script solution, will your other options. Also one more thing we do is we cc our mailbox mail id for all outgoing emails to have a track of all replied mails, will this could help in any way to find out which mails was missed?
If you need to track unread marks, I second the aforementioned nsftools solution, which works in Domino 7.x too. However, this is very much Notes ID-dependent. A folder would be better.
Note that 6.5x is well out of support, and that Domino 7.x officially died this week: use something at least vaguely modern!
There's an easier non-programmatic way. Just move the email from the inbox into another folder once the email has been responded to. That is more reliable than any programmatic solution, and keeps your inbox tidy (which will certainly be necessary if you get nearly 200 emails per hour!)
That said, here are some other ideas.
Determining if the document was read
Unread marks are not your friend here, unless you'll be accessing the mail file from the same client. Also they tend to get out of sync and would likely prove unreliable at some point, especially given the number of incoming emails. Instead you'll need to have some information that is saved within the individual mail document, such as the last accessed property or a custom item you manage via scripts/formulas.
You can see if an email has been read by checking the Last Accessed property of the mail document. According to IBM's technote (https://www-304.ibm.com/support/docview.wss?uid=swg21086670), the property will be updated when the document is read.
You could write a script in the QueryOpen event that stamps a value on the document and saves it.
Determining if the email was responded to
First off, I'd suggest you save all sent emails in case you need a record of what was sent to the client. That won't give you a way to see which emails have not been responded to, however.
Instead you could add script to the reply action within the memo form. When someone click's reply it could update the current memo, stamping an item on it to say who replied and at what time, for instance. Then you can create a view to show any emails that don't have that item, and another view to show emails that do grouped by who responded. The second view could even show how many emails each person responded to, something that might be used as a measurement of performance perhaps.
"Unread mark" checking is not exposed in the API.
I did find 2 links, this one is a basic implementation, where as this link does have more robust code and is implemented as an object in LotusScript. It should be compatible with Notes 6.5+.
I found the second link through nsftools website which has lots of great snippets that solve various problems. You should at least be able to detect if a mail has been read or not. Note that it requires making API level calls. You should be able to create a new script library and copy/paste the code into it.

Resources