B
B
BValentin2020-01-16 12:30:46
1C-Bitrix
BValentin, 2020-01-16 12:30:46

How to add a newsletter to a subscription?

There is a subscription form on the site:

<form class="subscribe Subscribe" action="">
  <input type="hidden" name="SITE_ID" value="<?=$arParams['SITE_ID']?>">
  <div class="form-row-sub">
    <div class="form-item-sub">
      <input type="email" name="EMAIL" placeholder="Введите Вашу почту" class="input-text" required>
    </div>
    <div class="form-item-sub">
      <input type="submit" value="ОК" class="input-btn btn btn-secondary">
    </div>
  </div>
  <div class='msg_after_send'></div>
  <div class="form-row-sub">
    <div class="form-item-sub">
      <label class="policy-label" for="Subscribe_checkbox">
        <input type="checkbox" name="rule" id="Subscribe_checkbox">
        <span>Я согласен с <a href="/customers/politics/">правилами рассылки</a></span>
      </label>
    </div>
  </div>
</form>

The subscription is in progress, but the mailing list is not checked.
What should I put in this form to select the desired (or all) mailing list?.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2020-01-16
@BValentin

In the code in the comments, you need to replace $RUB_ID = 1 with $RUB_ID = array(1)
To confirm the subscription, add 'CONFIRMED' => 'Y' to $arFields
In my opinion, a bad idea, it turns out that anyone can sign anyone ))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question