How to transfer a string with Selenium in WhatsApp when sending messages?

Send message:
template = {
 'other': 
'Text.'
 'Another text.'
 'And the text.'
 'All the last text.'
}


def send_message(driver, answer):
driver.find_element_by_xpath('XPATH').click()
 action = ActionChains(driver)
action.send_keys(answer)
action.send_keys(Keys.RETURN)
 action.perform()

Depending on the received messages from the template does need an answer and passed to the send_message() as the argument answer.
If you send the message as is, then it comes to WhatsApp in one line:
Text.More text.And another text.All the last text.

If you add \n each row is sent to a new message, i.e. like this:
5cf8faa8701b5547068844.jpeg
March 23rd 20 at 19:21
1 answer
March 23rd 20 at 19:23
Solution
The solution helped @sim3x
def send_message(driver, answer):
driver.find_element_by_xpath('XPATH').click()
 for line in answer.split('\n'):
ActionChains(driver).send_keys(line).perform()
ActionChains(driver).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.SHIFT).key_up(Keys.ENTER).perform()
 ActionChains(driver).send_keys(Keys.RETURN).perform()

Find more questions by tags MessengersSeleniumPython