Developer forum

Forum » Templates » Forms for editors - how to link files in the email template

Forms for editors - how to link files in the email template

Lise T. Pedersen
Reply

Is there anybody who can/will help me with an exact example on an RAZOR email template to forms for editors, where an uploaded file is shown as a clickable link? Please!

/Lise


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Lise,

 

Try this on your razor template

@foreach (var field in GetLoop("FieldValues").Where(f => !f.GetBoolean("Field.IsButton")))
{ 
    if (field.GetString("Field.Type") == "File")
    {
        <a href="@GetString("SubmitData.Value")">@Translate("download", "Download")</a>
    }
}

 

Best Regards,

Nuno

 
Lise T. Pedersen
Reply

At first thanks, Nuno. I will have a look at it!

Best regards,
Lise

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Lise,

 

Just replace line 426 with

if (field.GetString("Field.Type") == "File")
{
    <a href="@submitValue">@Translate("download", "Download")</a>
}
else
{
    @submitOptionText
}

 

Best Regards,

Nuno

 

You must be logged in to post in the forum