Front end Newsletter Edit Form
- Hubert
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
1 year 1 week ago #1
by Hubert
Front end Newsletter Edit Form was created by Hubert
At the moment when I (as logged in user in Jommla) edit a new Newsletter automaticly my name and my e-mailadress is filled in the input fields for the sender.
Is there any possibility to fill in this fields automaticly with another sender name and another sender e-mail adress?
Is there any possibility to fill in this fields automaticly with another sender name and another sender e-mail adress?
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
1 year 1 week ago #2
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Front end Newsletter Edit Form
Hello Hubert and thank you for posting!
At the moment, it's not possible to change this behavior with the available options.
You can create a template override of the file components/com_nspro/tmpl/newsletters.php and add the following lines just before line 44:
Let me know if that helps.
At the moment, it's not possible to change this behavior with the available options.
You can create a template override of the file components/com_nspro/tmpl/newsletters.php and add the following lines just before line 44:
Code:
$this->defaultFName = 'the default name you want here';
$this->defaultFEmail = 'another@email.com';
$this->defaultReplyToEmail = 'another.replyto@email.com';
Let me know if that helps.
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Hubert
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
1 year 1 week ago #3
by Hubert
Replied by Hubert on topic Front end Newsletter Edit Form
For the e-mail it helps. Thank you so much.
I have two additional questons:
I tried to preselect a mailing list but it was not successful. In the file newsletters_froms.php I tried to modify the following code:
foreach($this->lists as $alist) {
++$xi;
if (is_array($allowed_lists) && count($allowed_lists)) {
if (!in_array($alist->id, $allowed_lists)) { continue; }
}
print '<option value="'.$alist->id.'">'.$alist->lname.'</option>';
}
with a selected in the option I tried to preselect an item. I have to say I have only one mailing list at the moment.
Second question: how can I prefill the field subject and the field preview line?
Regards
Hubert
I have two additional questons:
I tried to preselect a mailing list but it was not successful. In the file newsletters_froms.php I tried to modify the following code:
foreach($this->lists as $alist) {
++$xi;
if (is_array($allowed_lists) && count($allowed_lists)) {
if (!in_array($alist->id, $allowed_lists)) { continue; }
}
print '<option value="'.$alist->id.'">'.$alist->lname.'</option>';
}
with a selected in the option I tried to preselect an item. I have to say I have only one mailing list at the moment.
Second question: how can I prefill the field subject and the field preview line?
Regards
Hubert
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
1 year 1 week ago #4
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Front end Newsletter Edit Form
Hi again Hubert,
To pre-fill the subject and preview line, you can add value="the pre-filled value goes here" to the inputs in line 72 and 75 of the newsletter_forms.php file respectively.
Something like this:
To pre-select a mailing list, you can change lines 92 to 98 like this:
If you have any subsequent questions, please make sure that they are still relevant to this topic's subject line. If they are, feel free to post them here.
Otherwise, I would appreciate it if you open a separate thread.
Thanks again!
To pre-fill the subject and preview line, you can add value="the pre-filled value goes here" to the inputs in line 72 and 75 of the newsletter_forms.php file respectively.
Something like this:
Code:
<input type="text" name="nspro_nsl_subject" id="nspro_nsl_subject" class="nsproeditor inputbox form-control" placeholder="<?php print Text::_('SUBJECT'); ?>" value="value goes here"/>
To pre-select a mailing list, you can change lines 92 to 98 like this:
Code:
$allowed_lists = $this->mparams->get('allowed_mailing_lists', array());
foreach($this->lists as $alist) {
if (is_array($allowed_lists) && count($allowed_lists)) {
if (!in_array($alist->id, $allowed_lists)) { continue; }
}
$selected = (in_array($alist->id, ['1', '2', '3', '4', 'your-list-ids-go-here'])) ? ' selected="selected" ' : '';
print '<option value="'.$alist->id.'" '.$selected.'>'.$alist->lname.'</option>';
}
If you have any subsequent questions, please make sure that they are still relevant to this topic's subject line. If they are, feel free to post them here.
Otherwise, I would appreciate it if you open a separate thread.
Thanks again!
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Hubert
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
1 year 1 week ago #5
by Hubert
Replied by Hubert on topic Front end Newsletter Edit Form
Hello Christopher
thanks for the support. It helps, for seleted item I made this mistake to include only selected not selected="selected". Stupid fault.
But regarding the subject filed something is strage.
If I only put the value statement in, like you proposed nothing happens, only the placeholder is shown.
If I add the same input statement with same name and id before then it works. Dont ask me why. I put now this additional input field in and made it type = "hidden". And then it works. Strange but it works.
Regards Hubert
thanks for the support. It helps, for seleted item I made this mistake to include only selected not selected="selected". Stupid fault.
But regarding the subject filed something is strage.
If I only put the value statement in, like you proposed nothing happens, only the placeholder is shown.
If I add the same input statement with same name and id before then it works. Dont ask me why. I put now this additional input field in and made it type = "hidden". And then it works. Strange but it works.
Regards Hubert
Please Log in or Create an account to join the conversation.
- Hubert
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
1 year 1 week ago #6
by Hubert
Replied by Hubert on topic Front end Newsletter Edit Form
I'm still facing a problem with this subject to select by default.
I integrated code as you mentioned. But in the form the item is not selected and if I save the newsletter then in the newsletter list its mention no mailinglist selected. Seems the form did not update the select field.
I integrated code as you mentioned. But in the form the item is not selected and if I save the newsletter then in the newsletter list its mention no mailinglist selected. Seems the form did not update the select field.
Please Log in or Create an account to join the conversation.
Moderators: Christopher Mavros