Skip to main content
so my developer has created a Quick Action Button 'SendInvite' that generates a custom webform, requires a box to be checked, and Send to be clicked and it sends from a predefined email template.

 

I would like to replicate this action but with a different button name, and a different email template.  

 

I cannot for the life of me find anywhere in the Lightning Component.cmp or controller.js where it actually defines the email template to be pulled.

 

Can someone point me in the right direction please?
3 respuestas
  1. 27 dic 2019, 16:57

    that is what I was thinking, but nothing stands out. I am new to this and would like to learn vs having to reach out to a 3rd party developer.

    ({

    doInit : function(component, event, helper) {

    var eventID = component.get("v.recordId");

    var action = component.get("c.emailTemplateMethod");

    action.setParams({ "eventId" : eventID, "Key":"Notification" });

    action.setCallback(this, function(response) {

    component.set("v.EmailtempRecord",response.getReturnValue());

    console.log('current--' + JSON.stringify(response.getReturnValue()));

    }),

    $A.enqueueAction(action);

    },

    sendEmail : function(component, event, helper) {

    var eventID = component.get("v.recordId");

    var action = component.get("c.triggerEmail");

    action.setParams({ eventId : eventID, "Key":"Notification" });

    action.setCallback(this, function(response) {

    var state = response.getState();

    if (state === "SUCCESS") {

    var toastEvent = $A.get("e.force:showToast");

    toastEvent.setParams({

    "type":"success",

    "message": "Engagement details sent to attendees via Email."

    });

    toastEvent.fire();

    $A.get('e.force:refreshView').fire();

    }

    else if (state === "INCOMPLETE") {

    // do something

    }

    else if (state === "ERROR") {

    var errors = response.getError();

    if (errors) {

    if (errors[0] && errors[0].message) {

    var toastEvent = $A.get("e.force:showToast");

    toastEvent.setParams({

    "type":"error",

    "message": errors[0].message

    });

    toastEvent.fire();

    }

    } else {

    console.log("Unknown error");

    }

    }

    $A.get("e.force:closeQuickAction").fire();

    });

    $A.enqueueAction(action);

    }

    })

0/9000