Added optional $layout argument to makeAndSend function, allowing to choose the desired layout when calling.