Trello: run a sed-like script when creating a card with email-to-board - automation

Trello has an awesome feature of creating cards or adding comment to a card from an email.
Sadly, emails come with a lot of crap (corporate signatures, disclaimers, attached logos...) that create clutter in trello boards.
So I would like to have Trello run a script when receiving those emails to
strip some regex away (or any kind of text processing)
remove attachments, based on file type, size, name...
Trello Butler (the 'automation' button) could use triggers like 'when card content changes', but there is no obvious action that would filter the content.
The question is: how can I configure Trello/Butler to pass the received text to some text processor (like sed for instance) to "sanitize" its inputs?
Note: Maybe there's a way using the send HTTP request action, but I don't know much of that part, and it doesn't look like it can deal with attachments

Related

Search keyword in PDF and check if exists

The idea was to be able to, as soon as a receive a mail with a PDF attached, find a way in which the PDF can be downloaded and be searched for a specific keyword (for instance, see if my name is in it) and if my name is on any of the pages of the PDF, then send another mail notifying the user that there’s a pdf in which he has been named.
This is in order to avoid having to check dozens of mails daily and PDFs just to see if your name is in it or not.
I managed to do this using Zapier but I relied on PDFco’s API for the search, and it is payware, so I’m taking a different approach.
My question is more based on what library would make that search inside the PDF and would provide a Boolean value that said if the keyword exists or not.
Thank you!

Embed form in outlook email and capture response

I am trying to help people do their job. So every morning an email needs to go out to the users with a list to Approve/Reject... Don't want to send this email just like a warning, telling them to go to the app to perform their duty. The email needs to have the capability to capture their response and update the DB accordingly.
option 1: Embed all items in single email body as a form, something like...
Code - Description - radiobutton - radio button
111 ABC o Accept o Reject
222 DEF o Accept o Reject
Submit
On submit need to call a winforms app and need to pass the code and accept/reject status. I have not been able to find any thing to come up with a solution. Need to validate as well, making sure all appropriate radio buttons have been selected. Is it even possible?
Option 2: I am trying to avoid voting route where each item will go as a separate email. when the user will accept/reject, a reply will go to the email. Then some process will monitor that inbox and will pick the not read messages and update DB accordingly. Using the MailItemClass in Microsoft.Office.Interop.Outlook namespace.
var mailItem = (Outlook.MailItem)Application.CreateItem(Outlook.OlItemType.olMailItem);
mailItem.To = "some.address#server.com";
mailItem.Subject = "This is a test";
mailItem.Body = "This is the body of the message.";
mailItem.VotingOptions = "Accept; Reject;";
mailItem.Send();
I believe what you are asking for is possible but would be a lot of effort to implement.
For your approach, I assume the information for these emails comes from the DB. I would write a macro to interrogate the DB and create and send each email to the appropriate user.
On each user’s system I would have a rule that recognised these emails and called a macro to process them. The macro would extract the contents of the email, copy it to a form and pass control to the user. A Submit button would validate the user’s choices and save the results in global variables before returning control to the macro. On regaining control, the macro would update the DB.
This macro will be large and I am sure it will need maintenance. To protect itself from malware, Outlook does not provide any easy way of importing macros. The macro and the form will have to be manually imported to each user’s system, each time they change. Unless you have technically able users, it will be you who visits each system and updates it.
I would reject any approach that required code on the user’s systems.
To test an alternative approach, I manually created this email:
and sent it to myself. When I received the email, I actioned it as instructed. When I received the reply, it looked like:
The Html body for this reply is full of formatting information. You could extract the responses from it but I believe the text body would be easier. To create the following, I started with the text body, replaced every carriage return and line feed with [CR] and [LF] and then added a few new lines to make it marginally easier to read.
[CR][LF][CR][LF] [CR][LF][CR][LF]From: Tony Dallimore [mailto:a.j.dallimore#MyIsp.com] [CR][LF]Sent: 25 May 2018 14:22[CR][LF]To: 'Tony Dallimore' <a.j.dallimore#MyIsp.com>[CR][LF]Subject: Test email 2[CR][LF][CR][LF] [CR][LF][CR][LF]
Please:[CR][LF][CR][LF] [CR][LF][CR][LF]
1) Click Reply within the Home tab.[CR][LF][CR][LF]
2) You may find it helpful to click Pop Out.[CR][LF][CR][LF]
3) Enter “A” in the Accept column or “R” in the Reject column of every row in the following table.[CR][LF][CR][LF]
4) Click Send.[CR][LF][CR][LF] [CR][LF][CR][LF]Code[CR][LF][CR][LF]Description[CR][LF][CR][LF]Accept[CR][LF][CR][LF]Reject[CR][LF][CR][LF]
111[CR][LF][CR][LF]ABC[CR][LF][CR][LF]A[CR][LF][CR][LF][CR][LF][CR][LF]
222[CR][LF][CR][LF]DEF[CR][LF][CR][LF][CR][LF][CR][LF]R[CR][LF][CR][LF]
333[CR][LF][CR][LF]GHI[CR][LF][CR][LF]A[CR][LF][CR][LF][CR][LF][CR][LF]
444[CR][LF][CR][LF]JKL[CR][LF][CR][LF]A[CR][LF][CR][LF] [CR][LF][CR][LF]
[CR][LF][CR][LF] [CR][LF]
You would need a second macro to process these emails, extract the responses and update the DB. There is no validation on the user’s system but they are not being asked to do anything complicated. If you telephone and harangue them every time you get an incomplete reply, they will soon realise life is more pleasant if they get it right first time.
I do not know how difficult it is to access your DB from VBA but I do not believe anything else is particularly difficult.
This is not the approach you requested but I believe this will be very much easier to implement. More importantly, all the code is on your system which will make development and maintenance so much easier.

How do you access a Marketo Token in Velocity script

I'm creating an email in Marketo that is sent when a new article is posted on my website and contains a section at the bottom for a related article as well. The article and related article information are set up automatically using tokens (they are triggered via an API call).
I want to hide the related article section if there is no related article present. This seems like something that should be done via a Script token. However, I can't figure out how to access token data (e.g. {{my.related_post_headline}}) from within my script token. Is this possible? If not, what is the best practice for having dynamic content based on token data?
At this time it is not possible to read Program Tokens using Marketo's Velocity Scripting. You can read data from Lead fields and from Custom Objects.
Keep in mind that Velocity Scripting is relatively slow, so it may delay your email send for large volumes (it has to execute the script for each email). You can use Head Start if you're using an Email Program, which will pre-process the Velocity Script.
Alternatively, you could choose NOT to use Velocity Scripting and insert Lead Tokens or Program Tokens directly into the email. This will speed up email rendering.

How can I be notified of responses to a .ics file attached to an email?

If I attach an iCalendar file to an email, not a meeting or appointment but as an email with an attachment, is there any way I can be notified of responses/acceptances?
Maybe. iCalendar is a file format that is opened by another program (such as Google Calendar, iCal, etc) which processes the file.
For example, this could be the contents of the file:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1#example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe#example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
There's no way to embed a network call directly back to another service in the file to acknowledge acceptance of the iCalendar invite, like you embed <img/> pixels in emails which call back to a server for email analytics. However, it does support multiple "Relationship Component Properties". For your purpose, the most important field seems to be "Attendee" (Section 4.8.4.1 in the spec). This section might look like:
ORGANIZER:MAILTO:jsmith#host1.com
ATTENDEE;MEMBER="MAILTO:DEV-GROUP#host2.com":
MAILTO:joecool#host2.com
ATTENDEE;DELEGATED-FROM="MAILTO:immud#host3.com":
MAILTO:ildoit#host1.com
However, I believe its up to the client (like iCal) to parse the information out and use it for notifying of acceptances. So you may get notifications of acceptances from some people but not others, depending on their calendar client of choice.

Externally triggering Thunderbird into displaying a wanted message

I would like having a way to trigger Thunderbird, from an external script, into displaying a particular message in a particular folder.
If it were Firefox, say, I would use firefox -new-tab http://some-URL, and an already running Firefox (or a new one if none) would nicely fetch and display URL. But I found no way to do something equivalent with Thunderbird, neither on the Thunderbird site or through existing extensions, and even after some furious Googling around, which I attempted more than once!
One problem, compared to a plain URL, is the need some notation for selecting a message. Short of a better solution, I wrote a script which knows folder:SOME-FOLDER:ORDINAL, and behaves like an extension of xdg-open. My tool inserts a proper prefix and a few .sbd as needed within the SOME-FOLDER part to turn it into an absolute Thunderbird file reference, and ORDINAL picks a message in that folder. My tool then grabs the message, heuristically converts it into HTML file, and then, directs a Web browser to the resulting file (and if :ORDINAL is not given, it processes the whole folder instead, yielding an HTML index and many linked messages).
My current tool helps a bit at saving message references in other documents and efficiently retrieving them later, but I handle a copy of the Thunderbird message, and not the original. So if I want to delete it, refile it in another Thunderbird folder, and do other similar operation, I still have to go to Thunderbird, interactively find my way again to the wanted message before I can handle it, and this, is not efficient. What I'm dreaming of is a way to get rid of all my HTML conversion and browser trickery, but still keep the pseudo-URL paradigm and pseudo xdg-open interface, to directly force Thunderbird into the correct folder, with the wanted message correctly displayed.
In previous email readers I used (Emacs RMAIL and then Gnus, and Mutt as well later), such things could be managed, and I heavily used such capabilities in scripts. I am astonished, surprised, even a bit dismayed, by the apparent weakness of Thunderbird as a scriptable mail reader. Am I missing something evident? Any avenue or suggestion?
François
P.S. Of course, I agree that using ORDINAL is not very clever. It might mean a different message if the folder get some messages added or deleted. This is a lesser bad. A better but potentially heavier notation might use Message-ID values, but then, an index would also be needed to find the Thunderbird folder containing each message.
There seems to be some way to do it since Google Desktop supported it according to this thread - http://forums.mozillazine.org/viewtopic.php?f=39&t=584542. Perhaps try installing Google Desktop and see what kind of hyperlink its using?
I'll add Outlook supports using external hyperlinks using the outlook: naming scheme, for example outlook:Inbox or outlook:0000000007A2379547B0624691F4FB2E5468A0D7642E2000. See http://www.davidtan.org/create-hyperlinks-to-outlook-messages-folders-contacts-events/ for more info.