How do I set the Google Form to automatically send to another user in HTML format other than respondent? - forms

How do I set the form to automatically send to another user in HTML so it looks like the one the user gets when the user checks the "Send me a copy of my responses" box? I can't figure out how to set a script and/or trigger to send the HTML form to a user other than the respondent.

You can do this with google apps scripting, in particular the function MailApp.sendEmail. For HTML messages be sure to make use of the advanced parameters like htmlBody.
Check out the MailApp class for full details:
https://developers.google.com/apps-script/reference/mail/mail-app

Related

Trying to write App Script for sheets/forms to automate email response

I have a form and sheet but I'm not sure which is better to use to pull data from or create the trigger of form submit.
I am trying to create an email response to a form that is based on a google doc with images and text and will pull the name and responses from the form (or sheet).
Here are the work files. I will need to add this script to a different form/sheet later.
https://drive.google.com/drive/folders/1MhHOPjMD0JwVgP98majrKBPk-Cf1_Uwn?usp=sharing
There is actually an existing template for something related to what you are asking for in this Google developer documentation https://developers.google.com/apps-script/samples/automations/content-signup where you can easily make a copy of the file and change the values based on what you need.
This is basically allowing you to send emails from a trigger "onFormSubmit" based on what people filled in the Google form. Please let me know if you actually need the full code though! Or what exactly you are trying to achieve if the template is not working for you.

Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow?

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T
In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

How to send attachment with email in an ms access form

I was wondering would it be possible to create some sort of ms access form, where you would be able to upload any file and then be able to enter an email in another field, click a button, and send an email with said attachment to the entered email. So far I have the form created with an attachment field and below that I have a button and an empty field where the user can input an email that they would like to send the attachment to. My initial idea was to hard code the button to pull the attachment and send it to the desired email address using the .SendObject() function but i didn't find parameter for an attachment that I could send using the function.
:
In the highlighted box is where users can add any number of attachments and in the box to the right of the send button is a text box that would allow users to put in an email address that they would like to send it to.
If there is a better way of doing this with forms please let me know, I'm always up for learning new things.
You can interface with the outlook objectmodel to create a mailitem, then .send the message and .attach a file, but the file has to be accessible to the filesystem. If the file were embedded in access, you would have to export it out, then attach it. This link and this link should give you a good idea of how this process works.
If you don't have outlook available, then you will either need software that has a VBA compatible API, or you can use a webservice to post the mail, but both of those options are far to massive to talk about here, unless you can provide more specifics.
Edit since your edit:
If you can use Outlook, and you can just store the path to the file() in the attachments field as an array, then you an loop over the array with mailitem.attach to attach multiple files

E-mail hyperlinks: reading href value

So when you click on an email hyperlink, it opens up a new mail message window in the default mail client (Outlook in my case). You can append Subject, Body, CC and BCC fields directly to the email hyperlink and your mail client will automatically populate those values in the corresponding boxes. An example hyperlink field would be:
Send Mail
So here we go. User clicks the hyperlink and a new inspector window is opened by Outlook. I'm listening to NewInspector event in my Outlook add-in. Can I somehow get the full href of the link that was clicked to bring up this inspector window?
The reason I want this is that I'm appending some custom fields to the hyperlink, which obviously are not understood by Outlook. Can I get the entire href value through some direct property, or COM?
No, the Outlook object model (nor the mailto: protocol) doesn't provide anything for that. Instead, you can automate Outlook to fill the required values programmatically. For example, if Outlook is already running you can use the following code:
// If so, use the GetActiveObject method to obtain the process and cast it to an Application object.
application = Marshal.GetActiveObject("Outlook.Application") as Outlook.Application;
Read more about that in the How to: Get and Log On to an Instance of Outlook article. Also you may find the C# app automates Outlook (CSAutomateOutlook) sample project helpful.

How can I have a check box control form submit properties?

I'm putting together a pretty basic InfoPath 2010 form that will be filled out in a browser (by non-logged in users) and will generate an email upon submission. The client that I building the site for would like a user to be able to check a box to mark whether they would like to have the email address that they provided be CC'd on the form submission.
I know how to CC the email upon submission, but I haven't found anything that talks about using a check box to control it. I have tried playing around with rules and submit button options, but couldn't get exactly what I wanted to stick.
What I need is: if a user checks a box, they will get CC'd upon submission, and if they leave the check box unchecked, then they receive no email.
Use the code behind of the InfoPath form to accomplish this. Get the XPath of the field associated with the checkbox in the Form_Submit method of the code behind. If the field returns true, go ahead and CC, otherwise, don't CC.