expand field size to-email in form

Carlos Granados asked on April 20, 2020 15:59

Hello,

You can expand the size of the field to e-mail in the forms.

I want you to allow more emails.

thanks CMS version: 8.1 Build: 8.1.17

Recent Answers


Brenden Kehren answered on April 20, 2020 20:00

Typically for the email form control you check a box to allow for multiple emails and it will allow longer email strings.

0 votesVote for this answer Mark as a Correct answer

Carlos Granados answered on April 20, 2020 21:03

Hello Brenden Kehren,

Can you give me more information on where I can configure the field size?

Form - nameforms - email notification , field to-email

Thanks



0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 20, 2020 21:19

In that area, you can't do it there. How long do you anticipate the field needs to be? From what I can see there is no limit in the page's code. It may be a larger issue in the email queue's field since that ultimately stores the TO data.

0 votesVote for this answer Mark as a Correct answer

Carlos Granados answered on April 20, 2020 22:14

reviewing the code it visualizes that the field has a maxlegth of 200.

In this way, when the mail string to be notified exceeds 200 characters, I cannot enter more.

are there any settings to change this size?

Image Text

Thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 20, 2020 22:17

I'm not sure what code you're looking at but the field you have highlighted is NOT limited in code.

Check out file /CMSModules/BizForms/Tools/BizForm_Edit_NotificationEmail.aspx

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 21, 2020 07:27

Just to add what Brenden said - You can specify multiple addresses separated by semicolons. It is also listed in the documentation.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on April 21, 2020 09:35

To add a little note, the field is limited in code:

the file BizForm_Edit_NotificationEmail.aspx uses the EmailInput Control you can find at ~/CMSFormControls/Inputs/EmailInput.ascx

This uses logic to SetInputMaximumLength() based on if multiple addresses are allowed:

txtEmailInput.MaxLength = AllowMultipleAddresses
  ? ValidationHelper.MULTIPLE_EMAILS_LENGTH
  : ValidationHelper.SINGLE_EMAIL_LENGTH;

The values are constants directly set in the ValidationHelper class you can't edit. I don't have a version 8 at hand, but in later versions those are set based on RFC guidelines:

code max length constant


easiest around this would be to allow multiple Emails as suggested above. You could add your own logic in the EmailInput control file, although I'd recommend cloning it and referencing your own email input specifically in the BizForm_Edit_NotificationEmail.aspx-file. This however is a generic control probably used in a lot of places. So be careful on touching that and keep in mind this could cause problems whenever you're upgrading or applying hotfixes at a later time.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 21, 2020 10:21

Well, who is using long email addresses? also, if you really have to put there dozens of emails, isn't it easier to create a mailing group on the email server and just enter one email address for given mailing group? In this case it does not make much sense to adjust and maintain the code...

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on April 21, 2020 10:28

It might be filled with a macro which, in combination with the Hash, gets to long? But perhaps Carlos can enlighten us...

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 21, 2020 11:01

@David - if you want to use macro e.g. to get some value from the submitted data, you can use {%FieldName%} and with the hash...well the field name would have been really long - more 800 characters. I cannot imagine a developer using such a long ID names for fields :-)
Custom macro - well, again, who will use 800+ characters name for a macro method? :-)
In general you are right of course...but what are the odds someone will do it?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.