icalendar Event in QR Code - icalendar

I am generating a QR Code in InDesign to include in flyers, so that interested people can quickly scan the code and add the event to their calendar. The idea is if they can be reminded of the event, we get more people in the door.
So far, everything is working great...except: I don't know how to format the icalendar event such that I receive RSVP responses from people who scan the code. If the event had to change for whatever reason, I'd like to be able to email the people who scanned it. As I have it structured now, when I test scan the QR code my email address receives an invitation and not the expected RSVP response saying the scanner is attending. I have read the specifications for icalendar, but have come away just as confused because the specs are surprisingly short and thin.
Current ical event:
BEGIN:VEVENT
SUMMARY:Event Title
LOCATION:Venue Name\, Venue Address
DESCRIPTION:Event description
DTSTART:20171115T180000
DTEND:20171115T190000
URL:http://webaddress.org
ATTENDEE;RSVP=TRUE:mailto:myemail#address.org
BEGIN:VALARM
TRIGGER;RELATED=START:-PT120M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
It's the ATTENDEE line that I can't figure out. The spec makes it sound like that would cause the person responding to automatically send an acceptance to the email address that follows, which is mine as the event organizer. That's not what happens, so is there a different component to use to get what I desire?
Thanks!

This is an application concern, not anything to do with the iCalendar spec. I'll drive through your ical text quickly, though:
Your RSVP request is formatted fine.
You don't need the URL line.
You need VERSION:2.0. Some applications (like Apple's Calendar app) can't parse ical text without it.
You need a PRODID.
Depending on the location(s) of your attendees relative to the venue, it might make sense to specify a TZID, or (since it's not a recurring event) express your start and end time in UTC.
In general, you should use an iCalendar library like ical.net or ical4j to build your calendar events. They'll keep you from 1) needing to know the spec, which probably isn't a good use of your time and 2) shooting yourself in the foot because of #1.
The spec makes it sound like that would cause the person responding to automatically send an acceptance to the email address that follows, which is mine as the event organizer.
This is magical thinking: how would that happen? It would have to be handled by an application or operating system. Something that would "know how" to 1) understand ical, and 2) send a web request or an email or do something else.
The spec allows the organizer to indicate a preference with respect to RSVPs, that's all:
Purpose: To specify whether there is an expectation of a favor of a reply from the calendar user specified by the property value.
It's up to the implementer of the software to determine what that means in the application layer: send a web request, send an email, ignore it, etc.
Presumably scanning the QR code does something. How is the ical text loaded? How should it be loaded? By the user's mobile mail client? By the mobile calendar application? Something else? You need to figure out what THAT action should be, and figure out how to trigger or handle it.

My reading of the RFC suggests that a possibly better interpretation of this line:
ATTENDEE;RSVP=TRUE:myemail#address.org
is that you have added a single attendee, that attendee's email address is myemail#address.org, and that attendee is required to RSVP.
As a result, when you add this calendar event to your calendar, the calendar evaluates it and says: "Wait, we haven't even invited myemail#address.org." and then does so.
I actually wouldn't have expected that behavior, and would tend to see it as a bug (side-effect behavior that the user would have no reason to suspect, and which would potentially leak information (like their email address)).
It may help to think of this as you specifying the calendar entry as it will appear on their calendar, as if they created it. As such, they aren't an attendee, they are the organizer.
I think you need to specify a METHOD:REQUEST line per the RFC: https://www.rfc-editor.org/rfc/rfc5545#section-3.7.2 and IETF draft: https://datatracker.ietf.org/doc/html/draft-ietf-calsify-2446bis-09#section-3.2.2
This should change the entry from a static representation of an entry in your calendar to an invitation. You will probably need a few more things per the IETF doc (like a UID).

Related

FB Chatbot how to get the previous message

Is it possible to receive the previous message that the user have send to the chatbot (without using quick replies or postback buttons). Example:
User: "Can you call a friend?"
Bot: "Who should I call?"
User: "Tim"
In the API I now have just the information "Tim", without knowing if I should call him or text him or make him a sandwich or whatever. So I basically I want to add some Postbackdata or metadata additionally to the text "Can you call a friend" (intent: 'CALL'), so the message "Tim" will come with that data.
Is there a way without storing the data into a database? AWS Lambda with ClaudiaJs.
I found the metadata field in the FB API which turns out to be the wrong field for that since it is only for communicating between several apps?!
What you are looking for a called a "slot-based bot", or slot-filling, basically meaning that you have a "slot", or blank that needs to be filled in before your bot can perform an action. In your example you have two slots: action and person
Actions could be: call, text, message
Person: name of a person, friend, etc.
I don't think any of the message frameworks (Slack, Facebook, etc) will provide you with the information you need. You will need to build this logic out yourself.
You can look at using wit.ai stories to achieve this.
Look to this similar Stack Overflow question and answer.
You can reverse order of conversation, and at beginning user writes some text or send you something else. After receiving, you should send to user buttonsTemplate, where postbacks will be like "CallTo&Tim" where instead of Tim you can put every text you need to pass to next executor(and you also can store previous user message here). Than just make substring of postback, check it`s type and do whatever you want.

In Facebook messenger API, how to prevent button postback payload text from being logged to chat window on click?

TLDR; # bottom
I asked the following question in the Facebook bugs section
NOTE: This is more of a platform design suggestion than a bug, as I failed to find a Chat API feedback portal
Currently I'm building a Chat bot that allows the user to track a goal. It will say something like "Did you go for a walk on July 12, 2016 ?" and have Yes/NO buttons below.
Currently in order to pass the intent, the day and the achievement boolean I need to template a string like this "==GOAL== achieved? <<<{goal_achieved}>>>, date tracked [[[{date_tracked}]]]" and use regex to capture the delimited variables. This is prone to parsing error in other cases where the templated strings in the payload are user-input variables i.e. if the '{goal_achieved}' were replaced with the goal variable '>>meditated" then the regex that captures the templated variable could fail.
One could use the postback payload to store a JSON-encoded string but the problem with this is that the payload string gets logged into the user output and JSON strings are a bit ugly and confusing. The challenges I face could be easily remedied if the payload was not logged to the user Instead log the text for the button to help the user confirm the button was clicked.
If that is not possible, is there any other advice for encoding data into button payload ?
The following answer was offered (Mark Wiltse)
Hi Justin,
Unfortunately at this time our payload structure does not support the functionality that you are trying to implement. From my understanding you want to use the Payload to inform your backend if the user accomplished their 'goal' on that specific date. I would suggest that you create your payload response for the button on your end before passing it to us, which is basically the JSON idea that you had initially.
I know this is a bit cumbersome to handle but the payload response passed back is independent of the text that was provided with the messenger thread.
I would suggest that you also attempt to sanitize your strings if you are worried a user has previously provided you would cause an issue with your regex. You should be able to implement this functionality if the prior user data is sanitized to avoid any issues with regex/json parsing.
Since this is an implementation question I will have to close this report as Invalid. If you are still looking for additional insights and concrete tips for implementing this flow please post to our stack overflow where we have Facebook Engineers and a wide range of community members who also contribute.
http://facebook.stackoverflow.com/
Take care and best wishes with your messenger bot.
Mark
This sentence was particularly unclear:
I know this is a bit cumbersome to handle but the payload response
passed back is independent of the text that was provided with the
messenger thread.
TLDR;
Can anyone inform me of how to prevent the button from logging the payload string so that I can use it to pass JSON to my app without the user seeing it ?
Make sure to comment out sendTextMessage() in your receivedPostback() call :
function receivedPostback(event){
sendTextMessage(senderID, event.postback.payload);
}
From my understanding you're saying that when you press a button the PAYLOAD instead of the button's text is showing up.
Are you defining your buttons like this?
{
type: "postback",
title: "View Details",
payload: "details:12345"
}
I'd recommend removing any special characters that would mess with the parsing of your payload. As long as the special characters are not crucial to the user experience this is probably a fine solution.
If this doesn't solve your issue:
Can you add a screenshot showing the button you are pressing, and the log message you are talking about? From my understanding you're saying that when you press a button the PAYLOAD instead of the button's text is showing up. That's not the case for me, my buttons text shows up when I press a button.

Google analytics email open tracking with measurement protocol

we tried to track email opens with google analytics and measurement protocol. We exactly followed instructions given in http://www.lunametrics.com/blog/2013/06/17/email-tracking-google-analytics/ and http://dyn.com/blog/tracking-email-opens-via-google-analytics/
The problem is that every email open is counted also as a session which is not correct. Can you give me any advice how we can track opens without recording sessions? Thank you
Every hit in GA always starts a session, so this is not possible. If you don't want it to appear in your normal profile, try setting a pageview with prefix so you can filter them out into a seperate View.
e.g.
/virtual/email-open
Then set up your filters.
Session begins with any interaction. Don't be sad, it is correct.
You can extend your data with some identifier like virtualpagname or whatever and than make segment or filter.
dp=mypage.com
dh=/emailing
dt=Email Gate
You can either use datasource parameter:
ds=email
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#dataSource

Yet more questions on RESTful URIs

Numerical IDs vs names
As an example, which of these would you choose for identifying a single transaction, from a single bank account, for a single company:
/companies/freds-painting-ltd/accounts/savings/transactions/4831
/companies/freds-painting-ltd/accounts/1/transactions/4831
/companies/62362/accounts/1/transactions/4831
You idiot, something totally different! Crikey, did you even READ Fielding's dissertation?
Now, I think the 1st one is the most readable. If I have more than one company, or if I'm someone like an accountant managing multiple companies, it's immediately clear which company, and which account, I'm looking at. It's also more bookmarkable/emailable and would prevent 'fishing' for other companies by changing the company ID. I would want transaction IDs to be unique to an account (I.e. Both 'savings' and 'current' accounts could have transaction '1'
A 'company' will be my 'top-level', or 'first class' resource. Nothing at all would ever be shared between companies. As such, it would be the ideal candidate for a shard (or 'ancestor'/'namespace' in Google App Engine parlance). So I'd only have to worry about the account names being unique within one company. Every company could have an account called 'savings'.
Not sure what the situation in the rest of the world is, though LTDs or PLCs in UK would have a unique name, there could be many 'Dave's Window Cleaning' businesses (what's know as a trading name).
The business owner(s) could potentially opt for the top level /company/company-name URI to be public, and contain some basic details like their website, contact details etc, but everything below that would NEVER be accessible by search engines.
So my thoughts/concerns are:
1) Is it reasonable, when someone signs in to add their business, to say "Sorry, 'Dave's Window Cleaning' business is taken. How about 'Dave's Window Cleaning Portsmouth' (Having taken their location in another field)? My worry with this is that, for a more well known company, you're giving away the fact that they have an account with you. Or that someone could use that form to search for names. Perhaps not a biggie.
2) The size of the company name. Would it be reasonable for a name like 'Dave's Window cleaning, gardening, and loads of other stuff'? Thus creating a URL like 'daves-window-cleaning-gardening-and-loads-of-other-stuff/'
3) How to deal with someone changing their business name - I would approach it by creating a new company with that string ID, copying over everything, then deleting the old resource. The original URI would return 404 rather than redirecting - as you can't guarantee someone else won't want to take the now unused name, or even if more than one person has used the same name in the past.
4) Should the 'real' unique ID be an number in the back end, and for every request to be handled by first doing a query for what company ID this name actually related to.
5) The impact of searching for a transaction in the persistence layer.
6) The possibility of URL rewriting, but then that wouldn't work cleanly in GAE, nor would it solve the issue of ensuring company names are unique.
RESTful webservice vs RESTful website
So, we potentially have this lovely RESTful webservice that the latest snazzy iphone/android app can use (delusions of grandeur). But what about the main website itself? I note, right now, that the URL I see at the top of my page is not 'RESTful': /questions/ask is an action. There is no 'ask' resource on the server. It's more the state of the page, the preparation for POSTing to /questions/ - or if I'm editing, PUTing to /questions/{id}
I also note that Stackoverflow has URIs like /questions/362352/name-of-the-question, and that the latter part can be omitted, and one will be redirected to it.
Should I host a completely separate webapp that consumes my lovely webservice (from the same domain)? Do I even need a separate REST server, or can I rely on content negotiation (JSON/XML) and HTTP verb to select the right method (I'm using Jersey), and return the right representation?
So I could have /companies/aboxo/ return the whole HTML page (using stringtemplate.org) if it's a GET /,text/plain or test/html, and JSON/XML for others?
But what happens for 'add/edit/delete' transaction? Would GET / /companies/freds-painting-ltd/savings/transactions/?template=add be ok (or GET ../transactions/352?template=edit), and that would return the right HTML?
Thinking about this last detail is driving me mad for some reason.
Comments, suggestions, outright ridicule - all welcome!
Marcos
Rails solves the "id vs name" problem by displaying both in the URL but using only the id to actually identify eg:
/companies/62362-freds-painting-ltd/accounts/1-savings/transactions/4831
ie - for the ones that have a "pretty url" the function that generates your path write both the id and the name... but for your router, where relevant: you strip off everything thats not the id.
incidentally, it means your customer could actually write whatever they like into the URL and it'd make no difference:
/companies/62362-i_luv_blue_turtles/accounts/1-your_mum/transactions/4831
and your router still just sees:
/companies/62362/accounts/1/transactions/4831
:)
For a cannonical URI I suggest just /transactions/{id} as I presume the transaction knows what the company and account is. Therefore, #4 :-)
Is SEO a concern? I presume you don't want random folks off the internet googling for X company's transactions?! Therefore, I would just keep names (which may change) out of the URI.

Embed indentifier within an Email

I am trying to embed an ID into an email so that when a recipient replies to an email that my system sends out, my system can pick it up and match the two together.
I have tried appending a custom header, however this is stripped out when the user replies.
I have tried embedding an HTML comment within the email, but outlook does not seem to keep comments when a reply email is created.
Worst case scenario, I can manually try and match the sent and received emails by time span or have a visible tag within the message body.
Does anyone know of a more elegant solution?
Thanks in advance
Email messages already contain such an identifiers, called Message-ID. And there's even a way to send which message you're replying to by sending that ID in a header called In-Reply-To. That's done by pretty much all email clients, that's how they usually do their threading.
It's defined in RFC 822 (yep that's pretty old) and probably re-defined and refined in more modern versions of that.
I have seen a method that includes a one byte image with a unique name that's linked to the user. When they view the email and download the images, your HTTP server will record a hit for that unique image. Of course the user needs to display images, but you can include a message in the body asking them to display the images. We actually include content in an image so they need to show images.
If your incoming e-mail can handle +foo or -foo suffixes, use that.
Many e-mail systems can route user+foo#example.com or user-foo#example.com
to user#example.com. You can replace foo with some kind of identifier.
Several mailing list servers use this for tracking bounces.
While I can't say for certain, my investigation in that sort of matter some time ago yielded the following "conclusion":
Headers are transformed a lot
Message bodies are transformed a lot
This is partly because, I suspect, of:
Need to protect users from malicious intentions
Need to perform "targeted marketing"
I have seen "unique codes" flying around in clear text in the email body but I would suggest having a unique identifier embedded in the return address instead.
The usual approach is to place the id in the subject line and/or somewhere visible in the message text and informing the recipient that he should not modify the subject or quote the original mail when responding.