import Sendgrid from 'sendgrid';

const helper = Sendgrid.mail;
const sender = new helper.Email('adiemerci@bisnär.ch');
const reciever = new helper.Email('tuelsch@gmail.com');
const content = new helper.Content('text/plain', 'He, tsäueli');
const subject = 'Nöis mail';
const mail = new helper.Mail(sender, subject, reciever, content);
const sendgrid = Sendgrid(process.env.SENDGRID_API_KEY);
const request = sendgrid.emptyRequest({
  method: 'POST',
  path: '/v3/mail/send',
  body: mail.toJSON(),
});

export default function () {
  return sendgrid.API(request)
    .then((response) => {
      console.log(response.statusCode);
      console.log(response.body);
      console.log(response.headers);
    })
    .catch((error) => {
      console.error(error);
    });
}

@@ -623,27 +623,37 @@
 log(
-response.statusCode
+JSON.stringify(response.body)
 );%0D%0A
@@ -679,20 +679,26 @@
 esponse.
-body
+statusCode
 );%0D%0A    
@@ -784,22 +784,38 @@
 e.error(
+JSON.stringify(
 error)
+)
 ;%0D%0A    %7D

Stringify error output