Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jon 1 post 71 karma points notactivated
    Oct 28, 2019 @ 12:18
    Jon
    0

    Umbraco forms - Razor email template

    Hope someone could help.

    I am quite new to Umbraco and using Razor to display form values within email templates. However, what I am trying to do is display certain fields in the email template, when a specific option is checked within a multiple-choice checkbox field.

    For example, the options in the multiple-choice checkbox are:

    • Document
    • Spreadsheet
    • Image
    • External Web Link

    I have done a few tests already, but it only seems to display one of the IF statements, even if 'Document' and 'Spreadsheet' is checked.

    Below is the example piece of code I am using. I have a feeling I am not using the correct code to get the checked options, for this specific field type, but like I said, I am quite new:

    What type(s) of media would you like to upload? @Model.GetValue("checkMediaType")

    'Document' option:

    @if (Model.GetValue("checkMediaType").ToString() == "Document")
    {
    
        
    Is the file being added to an existing page? @Model.GetValue("radioUploadPDFToExisting")
    What is the URL of the web page? @Model.GetValue("txtPDFLinkOfPage")
    In what area of the website will the file(s) go? @Model.GetValue("txtPDFFileGo")
    Files attached @Model.GetValue("uploadPDF")
    Please confirm that the filename is the description of the document @Model.GetValue("checkPDFConfirm")
    }

    Spreadsheet option:

    @if (Model.GetValue("checkMediaType").ToString() == "Spreadsheet")
    {
    
        
    Is the file being added to an existing page? @Model.GetValue("radioUploadExcelToExisting")
    What is the URL of the web page? @Model.GetValue("txtExcelLinkOfPage")
    In what area of the website will the file(s) go? @Model.GetValue("txtExcelFileGo")
    Files attached @Model.GetValue("uploadExcel")
    Please confirm that the filename is the description of the document @Model.GetValue("checkExcelConfirm")
    }

    Hoping someone could point me in the right direction. Thank you in advance for your answers.

    Jon.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" button below.

    Continue discussion

Please Sign in or register to post replies