Send email from New Form with link to newly created record

Home Forums Modern DFFS Send email from New Form with link to newly created record

Viewing 4 reply threads
  • Author
    Posts
    • #38319
      Amal Vellappillil
      Participant

        Hi,

        I have a requirement to send email from New form with the link to the newly created record. Here is what I tried so far:
        – Use a rule that uses after form is saved trigger.
        – Call a function from that rule.
        – Inside the function construct the email with the link to newly created record.
        – Create a separate list (which i had created earlier to make scheduled emails work).
        – Create a new record in that list.
        – I have aMicrosoft flow that runs periodically that picks up records from this list that hasnt been processed completely. If it needs to be sent now, it will send now and update the record as sent. If it needs to be sent on a later date, it skips it.

        Creating email from within a Javascript seems tedious and harder to maintain. Its pretty much impossible for those who are not developers to update this email on a later date. Is there any other solution that you can think of or recommend that can ease this process and make maintaining such rules not hard?

        The same question goes for scheduled emails as well.

        Thank you,
        Amal Vellappillil

      • #38322
        Alexander Bautz
        Keymaster

          You can use the DFFSID (you must add a field with internalname _DFFSID your list and the DFFSID will be autogenerated) like this from an email triggering on any trigger you like:

          Here is the new item: <a href="https://contoso.sharepoint.com/sites/YourSite/Lists/YourList?DFFSForm=disp&DFFSID=[[fieldValue:_DFFSID]]">Link</a>
          

          Scheduling emails is not possible directly from DFFSS. You must use a FLOW to achieve this (by adding a send-date field in your list item and using a FLOW that runs on a schedule every day looking from send-date match in the list).

          Alexander

          • This reply was modified 2 months, 1 week ago by Alexander Bautz. Reason: Fixed link-format
        • #38325
          Amal Vellappillil
          Participant

            Thank you for the tip on _DFFSID column.

            I know this is not possible now, but do you think in the future we can have something like this.
            – Setup a rule with all the emails that need to be scheduled (the ones with the same delivery date). This would just be a place holder for a function to get information from later.
            – Then from another rule (that calls a js function), refer to this rule and loop over the emails and get its to, bcc, cc, subject, body values.
            – Then using custom js function add it to the custom list that is used to scheduling email. (This part I am already doing)

            I am just looking to see if we can avoid having to construct the emails from within javascript as supposed to having it setup using a rule which can greatly help with maintaining it down the road.

            • #38327
              Alexander Bautz
              Keymaster

                Sorry, but I don’t think this kind of solution can be added to DFFS. This is because it in any case requires an external list and a custom FLOW to send the emails, and the technical setup of this would cause a lot of support requests…

                I think you are better off setting up a FLOW that runs on a schedule (every hour or every day) looking for items in the list that matches the send date set in a datepicker in the list item. Using a FLOW you can set up different conditions for different statuses, and send emails based on different schedules that reads the data from the list item directly when you send the email in the FLOW.

                Alexander

            • #38329
              Amal Vellappillil
              Participant

                I got the flow and the separate list setup and working.

                What i feel could be helpful from DFFS is that if we could avoid creating the email content from JS. Instead, if a rule can be used to be a placeholder with all the emails that needs to be scheduled, that would be great. Then in the js code, we will just have to reference the rule object, loop through all the emails, get all the email data and create a new record in the custom list. This will all have to be custom code, which I understand. But if we could create the emails in a rule to be referenced later, this would make it so much easier for future maintenances. I hope I am making some sense here.

                In classic DFFS we were able to look inside the rule object from JS. With modern DFFS I see only rulestate and trigger rule options related to a rule. Do you think exposing rules and it’s related data to JS is a possibility?

                Thank you,
                Amal Vellappillil

              • #38332
                Alexander Bautz
                Keymaster

                  Look at the change log for v1.0.75.0 and see if you can use the variables I exposed to accomplish what you want to do.

                  PS: I just published v1.0.76.0 also: https://spjsworks.com/changelog/

                  Alexander

              Viewing 4 reply threads
              • You must be logged in to reply to this topic.