Not showing RSVP buttons in email - ical-generator - calendar

Not getting RSVP buttons in the email. I'm using "ical-generator" NPM to generate ics file.
This is code to generate ics file
let eventObj = {
method: 'request',
start: new Date(startTime),
end: new Date(endTime),
summary: "testing meeting",
uid: uid,
sequence: 0,
description: description,
organizer: {
name: fullname,
email: email
},
attendees:[
{
mailto : 'user#gmail.com',
email : 'user#gmail.com',
name : 'john',
status : 'needs-action',
rsvp : true,
type : 'individual'
}
],
status: 'confirmed'
}
let cal = ical();
cal.domain(url).name('My ical invite');
cal.createEvent(eventObj);
my ics file will look like below
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//sebbo.net//ical-generator//EN
NAME:My ical invite
X-WR-CALNAME:My ical invite
BEGIN:VEVENT
UID:5f44e98484341386e4523ba1#dominname
SEQUENCE:0
DTSTAMP:20200825T103548Z
DTSTART:20200826T183000Z
DTEND:20200826T190000Z
SUMMARY:testing meeting
DESCRIPTION:meeting Description : testing
ORGANIZER;CN="peter":mailto:user1#gmail.com
ATTENDEE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP
=TRUE;CN="john";EMAIL=user#gmail.com:MAILTO:user#gmail.com
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR
in my mail, I'm getting ics like below (I'm using gmail)
Here I'm not getting RSVP buttons and also in my ics file 'METHOD:REQUEST' is missing.
could you please help me out of this
thank you

I place 'method' in the wrong place
it should be here
let cal = ical()
cal.method('REQUEST')
cal.domain(url).name('My ical invite')
Now I'm able to get RSVP button on email

Related

The property 'attendees' does not exist on type 'Microsoft.OutlookServices.Event' when trying to update event with Graph API

I'm using Graph API to update calendar events. I've encountered following error on attempt to update calendar event with specific ID: "The property 'attendees' does not exist on type 'Microsoft.OutlookServices.Event"
I'm doing PATCH request using following address:
https://graph.microsoft.com/v1.0//me/events/${id}
with this payload in JSON :
{
attendees: [{emailAddress: {address: "test#test.com", name: "Jan Kowalski"}, type: "required"}]
body: {content: ""}
end: {dateTime: "2022-11-20T21:13:51", timeZone: "Europe/Warsaw"}
location: {displayName: "Dom"}
start: {dateTime: "2022-11-13T21:13:51", timeZone: "Europe/Warsaw"}
subject: "My event"
}
According to the documentation such properties exist.
Get event and deleting event work.
What more when I am trying to do the same update query with the token copied from the Graph Explorer, updating works fine. I am using MSAL2 auth provider for authentication
The question is - am I doing something wrong? May it be something with permissions?

My bot sends an embed that is invisible to all users and shows no message sent

I've been working on using JS to create a simple Discord Bot for my server. I have been trying to have it send a message with the rules of the server embedded into it. When the /rules command is run, I receive a notification to state a message was sent, but there is no message to be seen on any device. I am able to view message history so I do not understand why there is no visible embed or message.
My code was made using Autocode's Discord Embed Builder, and has worked for other embeds within the same Bot. A link to view the full embed code in the Builder and see how it is supposed to look is here.
It would be much easier to learn to make these yourself than using a generator and trying to reverse engineer how their coding works:
a simple example would be this:
const {
MessageEmbed
} = require('discord.js')
module.exports = {
name: "rules",
description: "Post rules",
run: async (client, interaction) => {
// build the message
const embed = new MessageEmbed()
.setColor('#00ff00') //change the color if you want
.setTitle('Some Title')
.setDescription(`Some description`)
.addFields({
name: 'Rule Name/Number',
value: 'Rule text',
inline: true
}, {
name: 'Rule Name/Number',
value: `Rule text`,
inline: true
}, {
name: 'Rule Name/Number',
value: 'Rule text',
inline: true
})
// add more if needed
// send the message
interaction.channel.send({
embeds: [embed]
})
// confirm they are sent and complete the interaction only visible to you
return interaction.reply({
content: 'Done',
ephemeral: true
})
}
}

SendGrid - Not getting custom_args returned on bounce events

When sending emails through SendGrid's Node mail client ("#sendgrid/mail": "^6.4.0") we are adding some custom_args to the JSON submitted and all of them are text values. The webhooks for processed, delivered, open, and click events return the custom_args to us as expected. But when we receive a webhook for the bounce event the custom_args are not attached.
We are submitting:
{ personalizations: [
{ to: {
email: 'recipient#example.com',
name: 'Recipient Name'
}
}
],
from:
{
email: 'sender#example.com',
name: 'Sender Name'
},
reply: {
email: 'replyto#example.com',
name: 'Reply To Name'
},
custom_args:
{ envelopeId: '4aa4f5f8-9ba4-4ec3-a6cf-3098107f498d',
messageId: '105',
eventId: '251' },
subject: 'Test Email 1234',
content:
[ { type: 'text/plain',
value:
'This is a sample email, please click here: https://example.com' },
{ type: 'text/html',
value:
'This is a sample email, please <a href=\'https://example.com\'>click here</a>' } ],
mail_settings: { sandbox_mode: { enable: false } } }```
Got an answer back from SendGrid on this one. The issue is when a mail server does a slow bounce where it takes them some time to sort out that they do not have anyone with that name locally, then they sometimes return a brand new email to the sending server and that causes SendGrid to loose all of the context that was placed in the initial email.

Meteor - Send email with attachment from an INPUT TYPE FILE

I want to send an email when a form is submitted and one of the input is a type=file and I can't figure out how to attach this to the email.
I'm working with Meteor and the package "email" from Meteor. I know this package is based on mailComposer and I have to provide some informations in an object.
But I don't know how to provide some of them since I don't want the file of the user to be uploaded on my server.
I think I need to get the path and the filename. Filename is easy but how to get the path ?
I've tried it with FileReader but it created a "fake" path and it don't seem to work.
This is Meteor method I call on server-side:
sendEmail: function (to, from, subject, text, attachments) {
check([to, from, subject, text], [String]);
this.unblock();
Email.send({
to: to,
from: from,
subject: subject,
html: text,
attachments: attachments
});
}
And here's the informations I provide on client-side:
readFile(inputResume.files[0], function(e) {
var file = {
filename: $(e.target).find('[name="resume"]')[0].files[0].name,
path: e.target.result
}
});
function readFile(file, onLoadCallback){
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = onLoadCallback;
}
Meteor.call('sendEmail',
'email', // To
'email', // From
'subject', // Subject
'text' // Message
'file' // Attachment
);
Thank you for the help!
The attachment is an array type.
#param {Object[]} [options.attachments] Array of attachment objects, as
described in the mailcomposer documentation.

422 error, devise/backbone

I'm trying to set up a Rails app that uses Backbone with Devise for registration.
The response text in the error callback in the Chrome console says
responseText: "{"errors":{"email":["can't be blank"],"password":["can't be blank"]}}"
However, the log in the server says unprocessable entity
Parameters: {"email"=>"pp#rr.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "registration"=>{"email"=>"pp#rr.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}
(0.1ms) begin transaction
(0.1ms) rollback transaction
Completed 422 Unprocessable Entity in 4ms (Views: 0.3ms | ActiveRecord: 0.1ms)
I have a Backbone user model that sets the url for the save
UserRegistration = Backbone.Model.extend({
url: '/users.json',
paramRoot: 'user',
defaults: {
"email": "",
"password": "",
"password_confirmation": ""
}
});
In the associated view, I get the attributes from the registration form, set them in the model, and then save the model
var email = $('#email').val();
var password_confirmation = $('#password_confirmation').val();
var password = $('#password').val();
this.model.set({email : email, password_confirmation: password_confirmation, password: password})
this.model.save(this.model.attributes, {
success: function(userSession, response) {
console.log("success");
console.log(userSession);
console.log(response);
console.log(this.model.url);
},
error: function(userSession, response) {
console.log("error");
console.log(userSession);
console.log(response);
}
});
}
After setting the model attributes (before saving) i did a console.log(this.model.attributes), and they are set
Object {email: "oo#gmail.com", password: "snowy", password_confirmation: "snowy"}
My User model looks like this
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
end
Can anyone make any suggestions?
There were some recent issues with a recent Devise release only responding to html, so I installed Devise 2.1.2 to make it respond with json to make it compatible with Backbone. That is not the issue here.
paramRoot isn't part of Backbone core. In order to fix this problem, I had to include the sync library https://raw.github.com/codebrew/backbone-rails/master/vendor/assets/javascripts/backbone_rails_sync.js from the Backbone-Rails gem to make user part of the param root
url: '/users.json',
paramRoot: 'user',

Resources