protected function SubscriptionsAccountForm::getSubmitMessage in Simplenews 8
Same name and namespace in other branches
- 8.2 src/Form/SubscriptionsAccountForm.php \Drupal\simplenews\Form\SubscriptionsAccountForm::getSubmitMessage()
- 3.x src/Form/SubscriptionsAccountForm.php \Drupal\simplenews\Form\SubscriptionsAccountForm::getSubmitMessage()
Returns a message to display to the user upon successful form submission.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: Form state object.
string $op: A string equal to either ::SUBMIT_UPDATE, ::SUBMIT_SUBSCRIBE or ::SUBMIT_UNSUBSCRIBE.
bool $confirm: Whether a confirmation mail is sent or not.
Return value
string A HTML message.
Overrides SubscriptionsFormBase::getSubmitMessage
File
- src/
Form/ SubscriptionsAccountForm.php, line 37
Class
- SubscriptionsAccountForm
- Configure simplenews subscriptions of a user.
Namespace
Drupal\simplenews\FormCode
protected function getSubmitMessage(FormStateInterface $form_state, $op, $confirm) {
$user = $form_state
->get('user');
if (\Drupal::currentUser()
->id() == $user
->id()) {
return $this
->t('Your newsletter subscriptions have been updated.');
}
return $this
->t('The newsletter subscriptions for user %account have been updated.', array(
'%account' => $user
->label(),
));
}