Search code examples
google-apps-scriptgoogle-apps

Approval button in mail from AppScript


I followed this tutorial. I want to make the same example. I understand that i now, "publish as service" is "deploy as web app". After i wrote the code and i submit the message, i get an email with 2 buttons(as links). Approve and reject. Here is my problem. No matter what option i choose i get the following message "Sorry, the file you have requested does not exist."


Solution

  • Do you have a code?

    Have you tried the code below?

    var url = ScriptApp.getService().getUrl() + '?';
    var approve = url + 'approval=true'+'&reply=' + response.email; 
    var reject = url + 'approval=false'+'&reply=' + response.email;
    

    There is a new variant of the James Ferreira's code.