protected function SubscriptionsAccountForm::getSubmitMessage in Simplenews 3.x
Same name and namespace in other branches
- 8.2 src/Form/SubscriptionsAccountForm.php \Drupal\simplenews\Form\SubscriptionsAccountForm::getSubmitMessage()
- 8 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.
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 31
Class
- SubscriptionsAccountForm
- Configure simplenews subscriptions of a user.
Namespace
Drupal\simplenews\FormCode
protected function getSubmitMessage(FormStateInterface $form_state, $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.', [
'%account' => $user
->label(),
]);
}