I created actions and everything but somehow this code send an email with undefined values(in below example inputSubject is undefined).
import { emailSender } from 'wasp/server/email';
export const sendGUIMailRequest = async (inputName, inputEmail, inputSubject, inputPhone, inputEmailBody) => {
const subjectString = String(inputSubject);
try {
const info = await emailSender.send({
from: {
name: 'customer',
email: 'customer@requestphotoedit.com',
},
to: "mericozcan.project@gmail.com",
subject: subjectString,
text: "Hello world",
html: "Hello <strong>world</strong>",
});
return { success: true, info };
} catch (error) {
return { success: false, error };
}
};
If I directly set subject argument, Sengrid returns bad request error.. Like is there any example of sending mail with different arguments????
Note: If I set subject as simple string, it doesn't give error, and everything works perfectly fine.
When function is called, the arguments became undefined.