Add an Event to Google Calender by Sending an Email - gmail

I want to add an event to a google calendar by sending an email.
In fact, I created a calendar and i have the id of the calendar #hash##group.calendar.google.com
My idea was to send an ICS to that id but it does not work.
Example of the ics:
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20180910T100000
DTEND:20180910T120000
DTSTAMP:20180831T082208
ORGANIZER:mailto:######cozynergy.com
UID:1770733000016589223
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE;X-NUM-GUESTS=0:mailto:#hash##group.calendar.google.com
DESCRIPTION:my description
LOCATION:LOCATION
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:HEY THIS IS MY EMAIL TEST :)
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR

Related

Using Stripe/Apple Pay, how to request an email-receipt for successful payments in the app

Using Stripe/iOS, the user of the app can pay by credit card or by Apple Pay.
I want, from the app (not the server), to request an email receipt when payment is successful.
For Credit Card payment I do the following:
let paymentIntentParams = STPPaymentIntentParams(clientSecret: <paymentIntentClientSecret>)
paymentIntentParams.paymentMethodParams = paymentMethodParams
if let receiptEmail = self.receiptEmail {
paymentIntentParams.receiptEmail = <email address>
}
let paymentHandler = STPPaymentHandler.shared()
paymentHandler.confirmPayment(withParams: paymentIntentParams,
authenticationContext: authenticationContext) {
…
}
However for Apple Pay payment I don’t know which property to set. In the app, I implement the STPApplePayContextDelegate protocol.
Question: For Apple Pay payment, what and where I need to set the email-address for the receipt? Can you please provide a code snippet?
Thanks
After discussion with Stripe support, it seems that using STPApplePayContextDelegate there is no way to set the receiptEmail property in the payment intent.
The best approach is to change the server and set the receiptEmail at
the server
If you still want to make the change at the app, the workaround is to use the REST API to update the payment intent.
Below is the reply from Stripe support:
The STPApplePayContext does not support this directly -- it needs to be set on the payment intent. The iOS flow for card payments is described in [0] and support receiptEmail in the STPPaymentIntentParams [1], but the Apple Pay flow is different. If not set when you create the payment intent, you would then want to make a call to your server to update the payment intent [2] in the payment flow where you call the completion. Alternately, confirm the payment intent server-side after collecting the Apple Pay payment method client-side [3].
[0] https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=custom#ios-submit-payment
[1] https://stripe.dev/stripe-ios/docs/Classes/STPPaymentIntentParams.html#/c:#M#Stripe#objc(cs)STPPaymentIntentParams(py)receiptEmail
[2] https://stripe.com/docs/api/payment_intents/update#update_payment_intent-receipt_email
[3] https://stripe.com/docs/apple-pay?platform=ios#client-side

Outlook not reading ics file correctly like gmail

im using nodemailer to send a string generated by a package called ical-toolkit it correctly displayed the calendar event, with timezone accordingly in gmail. but in outlook it says that the calendar format is not supported. im not sure what i did wrong. mayb there's a standard that outlook reading the calendar differently from gmail? here's the generated ics file string:
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
X-WR-CALNAME:CRM Web Activities
METHOD:REQUEST
PRODID:node-ical-toolkit
X-WR-TIMEZONE:Asia/Phnom_Penh
BEGIN:VTIMEZONE
TZID:Asia/Phnom_Penh
END:VTIMEZONE
BEGIN:VEVENT
UID:3a208ff2
DTSTAMP;TZID=Asia/Phnom_Penh:20190925T081047
DTSTART;TZID=Asia/Phnom_Penh:20190926T150000
DTEND;TZID=Asia/Phnom_Penh:20190926T150000
SUMMARY:New note.
SEQUENCE:0
DESCRIPTION:do something
ORGANIZER;CN="The Almighty":mailto:miike.vaan#gmail.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Lead Manager:MAILTO:mike.van#clik.asia
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Mike:MAILTO:sanada.koei.kh#gmail.com
END:VEVENT
END:VCALENDAR

Set CustomProperties on appointment for all attendees

tl;dr
When setting CustomProperties to an appointment that has attendees, only the appointment for the organizer gets the CustomProperties. The properties do not propagate to the appointments of the other attendees.
Longer version
When we create an appointment with multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true).
However, when setting a custom property from our add-in (using the Outlook JavaScript API), only the organizer's appointment gets the custom property as we are unable to see the custom property when we log in as any of the other attendees.
Snippets from our code that is relevant:
Office.initialize = function (reason) {
$(document).ready(function () {
Office.context.mailbox.item.loadCustomPropertiesAsync (onCustomPropertiesLoaded);
});
};
function onCustomPropertiesLoaded(asyncResults) {
_customProps = asyncResults.value;
}
//Set custom properties
_customProps.set("myProp", "true");
_customProps.saveAsync(customPropertiesOnSaved);
Is there a way to have each copy of the appointment have the custom property?
When we create an appointment and have multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true).
Yes that's correct an attendees copy of the appointment is a separate new Item in that mailbox. On the back end Exchange server its a separate Mailbox Store Item they are not linked in any way (other then properties that can be used to correlate them) and the server does not update appointments in attendee mailboxes so they must always be updated by a client process (in the case of room mailbox the Mailbox assistant does this but this is still a client process that runs on the server).
However, when setting a custom property from our add-in, only the organizer's appointment gets the custom property as we are unable to see the custom property when we log in as any of the other attendees.
That is most likely happening because you need to first save the custom property on the Appointment before you add any attendees and send meeting invitations. Its important to first save the appointment with the property (or attachments) before you add any attendees, then when the server produces the invites those invites should include the custom property (you can check that is happening using a Mapi editor and looking at the invite being produced in the Sent Items folder of the Organiser). Its important to remember as the appointments aren't linked on the server updating the property on the organiser won't be reflected on the attendees copy unless your sending a Meeting update and that Meeting update is then accepted by the attendees which would then update their calendars.

Edit a credit card using Stripe checkout.js

Checkout from Stripe has a great way to add a credit card for a transaction, by simply invoking StripeCheckout.open().
Is it possible to use .open() to edit a card? (passing in the card token)
Also, where can I download a non-minified version of checkout.js to see the .open() method signature?
There is no way to edit a card that way. What you can do though is use Stripe Checkout to ask your customer for a new card without asking him to pay anything. The idea is to avoid setting the amount or data-amount parameter.
<form action="/charge" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_XXX"
data-name="Demo Site"
data-description="Update Card Details"
data-panel-label="Update Card Details"
data-label="Update Card Details">
</script>
</form>
You would get a new card token for that new card and you could then use the Update Customer API to save the new card on the customer.
As for your second question, there is unfortunately no unminified version of Checkout.js accessible at the moment.
Try http://unminify.com/ to see an unminified version of checkout.
I saw this done for the first time today. If you have an app where users log in, you should be able to do it with a custom Checkout integration (the above is the simple integration) found here https://stripe.com/docs/checkout#integration-custom
On the server side you would retrieve the customer via Stripe's API. From the linked custom example, you can pass the retrieved ID through to Checkout via session data so it knows which customer to update here:
$('#customButton').on('click', function(e) {
// Open Checkout with further options
handler.open({
name: 'Your Company Name',
email: customer_email,
id: customer_id,
zipCode: false,
});
I have not yet tested this, if I get a chance I'll report back.

Gmail unsubscribe link shows 'undefined', though link is correct

In Gmail when you have an email from a newslist, you get a 'unsubscribe' link next to the email address, like this:
Google+ <noreply-67e4f7ae#plus.google.com> Unsubscribe
If you click it, it says:
Unsubscribe from Google+
Google+ provides a page at plus.google.com
where you can manage your email subscriptions. Learn more
Okay, when I send newsletters, I get the following message with 'undefined' instead, note that the link is actually right, it's just the text label that's wrong:
Unsubscribe from newslist#mywebsite.com
Sender provides a page at
undefined where you can manage your email subscriptions. Learn more
I'm sending the following header:
List-Unsubscribe: <mailto:unsubscribe-request#mywebsite.com?subject=Unsubscribe+my+newsletter>,
<http://www.mywebsite.com/instant_unsubscribe.php?id=111&email=myemail#mywebsite.com>
Any ideas how I stop is saying 'undefined' and change 'sender' to my website?
Thanks!

Resources